Hello. I want my as output same as tensorflow output, but i’m unable to figuring out how array behaves? Why np.array perform the same way as in tensorflow and what is the difference between the output of tensorflow and pytorch, desdpite that both are tensors with dim = 10? Is there any other thing which i’m doing wrong
There are both the same, of shape (10). The difference you see is just an aesthetic difference in the printing.
If you print tensor1 or tensor2 shape and type in PyTorch you will have:
torch.Size([10]), torch.float32
which is strictly equivalent to TensorFlow’s TensorShape([Dimension(10)]) that you see.