<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def astensor(array: TensorLike) -> BKTensor: """Convert to product tensor"""

    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