tf.convert_to_tensor equivalent in pytorch code example Example: convert pytorch tensor to numpy na = a.to('cpu').numpy()