code: def astensor(array: TensorLike) -> BKTensor:
      
      tensor = tf.convert_to_tensor(array, dtype=CTYPE)
      if DEVICE == 'gpu':
          tensor = tensor.gpu()  # pragma: no cover
  
      # size = np.prod(np.array(tensor.get_shape().as_list()))
      N = int(math.log2(size(tensor)))
      tensor = tf.reshape(tensor, ([2]*N))
  
      return tensor
docs: Convert to product tensor