code: def shape(a):
      """
      Return the shape of a tensor.
  
      Parameters
      ----------
      a : array_like
          Input tensor.
  
      Returns
      -------
      shape : ExecutableTuple of tensors
          The elements of the shape tuple give the lengths of the
          corresponding array dimensions.
  
      Examples
      --------
      >>> import mars.tensor as mt
  
      >>> mt.shape(mt.eye(3)).execute()
      (3, 3)
      >>> mt.shape([[1, 2]]).execute()
      (1, 2)
      >>> mt.shape([0]).execute()
      (1,)
      >>> mt.shape(0).execute()
      ()
  
      >>> a = mt.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')])
      >>> mt.shape(a).execute()
      (2,)
  
      """
      a = astensor(a)
      op = TensorGetShape(ndim=a.ndim)
      return op(a)
  
file_path: mars/mars/tensor/base/shape.py
imports: import numpy
  from ...None import opcodes
  from ...core import ExecutableTuple
  from ...serialization.serializables import KeyField, Int32Field
  from ...utils import calc_nsplits
  from ..core import TensorOrder
  from ..datasource import tensor
  from ..operands import TensorOperand, TensorOperandMixin
label_desc: Use image node_id 1 for calling a global function with example usage: shape(a) and returns: op