def meshgrid(*xi, **kwargs):
  """This currently requires copy=True and sparse=False."""
  sparse = kwargs.get('sparse', False)
  if sparse:
    raise ValueError('tf.numpy doesnt support returning sparse arrays yet')

  copy = kwargs.get('copy', True)
  if not copy:
    raise ValueError('tf.numpy only supports copy=True')

  indexing = kwargs.get('indexing', 'xy')

  xi = [array_ops.asarray(arg).data for arg in xi]
  kwargs = {'indexing': indexing}

  outputs = tf.meshgrid(*xi, **kwargs)
  outputs = [utils.tensor_to_ndarray(output) for output in outputs]

  return outputs
This currently requires copy=True and sparse=False.
trax/tf_numpy/numpy_impl/math_ops.py