code: def _take_autograd(tensor, indices, axis=None):
      indices = _i("qml").numpy.asarray(indices)
  
      if axis is None:
          return tensor.flatten()[indices]
  
      fancy_indices = [slice(None)] * axis + [indices]
      return tensor[tuple(fancy_indices)]
  
imports: from importlib import import_module
  import autoray
  import numpy
  import semantic_version
  from scipy.linalg import block_diag
  from .utils import get_deep_interface
label_desc: Use image node_id 12 for calling a global function with example usage: _take_autograd(tensor, indices, axis) and returns: tensor, tensor