# About tensor shape and indexing it

Hello,

I have read this following issue: Shapes of the output tensors

Here’s my question:
My output tensor has a shape of (1, 21, 3) for representing hand joint positions in 3D coordinates.
When I do indexing on that tensor, such as `output[0, 12, 2]`, this code works. However, `output[1, 0, 0]` and `output[0, 2, 12]` also works even if their values are not correct.

UPDATE:
I read value in output[0, 1, 1] and output[0, 1, 4], but they all contain proper values. Is it coincidence that output[0, 1, 4] has a proper value due to memory addressing?

Then, how can I do indexing the output tensor correctly?

I also attached my code fragement in below section.
Thanks

``````worker.Execute(input);
TensorFloat output = worker.PeekOutput("output");
var temp = output;
Debug.Log(output.shape) // return (1, 21, 3)

// in another function
temp[0, 12, 1], temp[1, 0, 0], temp[0, 1, 12] // do not call error
``````

Check the doc for tensor accessors:

``````    /// <summary>
/// Returns the tensor element at offset `(d2, d1, d0)`, which is position `d2 * stride1 + d1 * stride0 + d0`.
/// </summary>
public float this[int d2, int d1, int d0]
``````

`1, 0, 0` → will read at 1213+ 03 + 0 = 63 >= tensor.length => outof bound read = error/undefined behavior
`0, 2, 12` → will read at 0
213+ 23 + 12 = 18 < tensor.length => in range so no error

We could assert on all dimensions of accessors but we chose not too for flexibility