def encoded_capacity(wmb, data, num_bits):
  """
  Returns the total capacity in bits of the bitmask + data

  :param wmb: weight mask bits -- bit vectors to indicate non-zero values in original weight matrix M

  :param data: Data corresponding to the non-zero elements of matrix M

  :param num_bits: number of bits per data value to use

  """
  return (data.size()[0]*num_bits + wmb.size()[0])