Hi @muhibkhan,
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.