I read this in tensor.view() function documentation.
Could you take this example?
I tried but I got error

z
Out[12]:
tensor([[ 0.9739,  0.6249],
[ 1.6599, -1.1855],
[ 1.4894, -1.7739],
[-0.8980,  1.5969],
[-0.4555,  0.7884],
[-0.3798, -0.3718]])
z = x.view(1, 2)
Traceback (most recent call last):
File “D:\temp\Python35\lib\site-packages\IPython\core\interactiveshell.py”, line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “”, line 1, in 
z = x.view(1, 2)
RuntimeError: invalid argument 2: size ‘[1 x 2]’ is invalid for input with 12 elements at …\aten\src\TH\THStorage.cpp:84