Sorry my bad!! Didn't make the correct imports
Also I'm facing some issues with the code. ops.reshapes is showing unexpected behaviour. Here's my code:
Output:
t:
Tensor([[[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]]], dtype=float32, shape=1x2x2)
output:
Tensor([[0.0, 0.0],
[-0.56482106447219849, 1.5331770181655884]], dtype=float32, shape=2x2)
But if I add the following code at the end of my code:
The output becomes correct:
t:
Tensor([[[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]]], dtype=float32, shape=1x2x2)
output:
Tensor([[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]], dtype=float32, shape=2x2)
t.reshape((2,2)):
Tensor([[1.2788280248641968, -1.2873831987380981],
[-0.56482106447219849, 1.5331770181655884]], dtype=float32, shape=2x2)
And it's not the case with reshape only.
e.g., this program uses split op:
And this is the output log:
t:
Tensor([[1.2788280248641968, -1.2873831987380981, -0.56482106447219849, 1.5331770181655884],
[0.80901926755905151, -0.24991747736930847, -0.8085181713104248, 0.42681333422660828],
[1.8432825803756714, -0.60748469829559326, 0.24848183989524841, -0.3757627010345459],
[1.6167833805084229, 1.0938529968261719, 0.35813808441162109, 0.071096442639827728],
[1.5071860551834106, -0.54008448123931885, -0.18514452874660492, 0.30583590269088745],
[0.34934023022651672, -1.6976139545440674, -1.2638821601867676, -0.97573941946029663]], dtype=float32, shape=6x4)
output:
Tensor([[2.2701208643344754e+37, 4.2833490159016683e-41, -0.56482106447219849, 1.5331770181655884],
[0.80901926755905151, -0.24991747736930847, -0.8085181713104248, 0.42681333422660828]], dtype=float32, shape=2x4)
output1:
Tensor([[1.8432825803756714, -0.60748469829559326, 0.24848183989524841, -0.3757627010345459],
[1.6167833805084229, 1.0938529968261719, 0.35813808441162109, 0.071096442639827728],
[1.5071860551834106, -0.54008448123931885, -0.18514452874660492, 0.30583590269088745],
[0.34934023022651672, -1.6976139545440674, -1.2638821601867676, -0.97573941946029663]], dtype=float32, shape=4x4)
t:
Tensor([[1.2788280248641968, -1.2873831987380981, -0.56482106447219849, 1.5331770181655884],
[0.80901926755905151, -0.24991747736930847, -0.8085181713104248, 0.42681333422660828],
[1.8432825803756714, -0.60748469829559326, 0.24848183989524841, -0.3757627010345459],
[1.6167833805084229, 1.0938529968261719, 0.35813808441162109, 0.071096442639827728],
[1.5071860551834106, -0.54008448123931885, -0.18514452874660492, 0.30583590269088745],
[0.34934023022651672, -1.6976139545440674, -1.2638821601867676, -0.97573941946029663]], dtype=float32, shape=6x4)
output:
Tensor([[2.2701208643344754e+37, 4.2833490159016683e-41, -0.56482106447219849, 1.5331770181655884],
[0.80901926755905151, -0.24991747736930847, -0.8085181713104248, 0.42681333422660828]], dtype=float32, shape=2x4)
output1:
Tensor([[1.8432825803756714, -0.60748469829559326, 0.24848183989524841, -0.3757627010345459],
[1.6167833805084229, 1.0938529968261719, 0.35813808441162109, 0.071096442639827728],
[1.5071860551834106, -0.54008448123931885, -0.18514452874660492, 0.30583590269088745],
[0.34934023022651672, -1.6976139545440674, -1.2638821601867676, -0.97573941946029663]], dtype=float32, shape=4x4)
It is also extracting the wrong first 2 outputs in row 1.