def bits(tensor: tf.Tensor, bitsize: Optional[int]=None) -> list:
    'Extract bits of values in `tensor`, returning a list of tensors.'
    with tf.name_scope('bits'):
        bitsize = (bitsize or (tensor.dtype.size * 8))
        the_bits = [tf.bitwise.bitwise_and(tf.bitwise.right_shift(tensor, i), 1) for i in range(bitsize)]
        return the_bits
Extract bits of values in `tensor`, returning a list of tensors.
def bits(tensor: tf.Tensor, bitsize: Optional[int]=None) -> list:
    
    with tf.name_scope('bits'):
        bitsize = (bitsize or (tensor.dtype.size * 8))
        the_bits = [tf.bitwise.bitwise_and(tf.bitwise.right_shift(tensor, i), 1) for i in range(bitsize)]
        return the_bits