code: def sg_reshape(tensor, opt):
      r
      assert opt.shape is not None, 'shape is mandatory.'
      return tf.reshape(tensor, opt.shape, name=opt.name)
docs: r"""Reshapes a tensor.
      
      See `tf.reshape()` in tensorflow.
  
      Args:
        tensor: A `Tensor` (automatically given by chain).
        opt:
          shape: A tuple/list of integers. The destination shape.
          name: If provided, replace current tensor's name.
  
      Returns:
        A `Tensor`.