class_docstr: Tests for the Tensor(ndarray) subclass
class_docstr_tok: ["Tests","for","the","Tensor","(","ndarray",")","subclass"]
docstr: Test that indexing into a tensor always returns a tensor
docstr_tok: ["Test","that","indexing","into","a","tensor","always","returns","a","tensor"]
code: def test_indexing(self, grad):
      """Test that indexing into a tensor always returns a tensor"""
      x = np.tensor([[0, 1, 2], [3, 4, 5]], requires_grad=grad)
  
      assert isinstance(x[0], np.tensor)
      assert x[0].requires_grad is grad
  
      assert isinstance(x[0, 0], np.tensor)
      assert x[0, 0].requires_grad is grad
      assert x[0, 0].shape == tuple()
      assert x[0, 0].item() == 0
  
imports: import numpy
  import pytest
  from autograd.numpy.numpy_boxes import ArrayBox
  import pennylane
  from pennylane import numpy
  from pennylane.numpy.tensor import tensor_to_arraybox
label_desc: Use image node_id 4 for calling the TestTensor obj's underlying member method code with example usage: obj.test_indexing(grad) without return types