W3cubDocs

/TensorFlow Python

tf.meshgrid(args, *kwargs)

tf.meshgrid(*args, **kwargs)

See the guide: Tensor Transformations > Shapes and Shaping

Broadcasts parameters for evaluation on an N-D grid.

Given N one-dimensional coordinate arrays *args, returns a list outputs of N-D coordinate arrays for evaluating expressions on an N-D grid.

Notes:

meshgrid supports cartesian ('xy') and matrix ('ij') indexing conventions. When the indexing argument is set to 'xy' (the default), the broadcasting instructions for the first two dimensions are swapped.

Examples:

Calling X, Y = meshgrid(x, y) with the tensors

x = [1, 2, 3]
y = [4, 5, 6]

results in

X = [[1, 1, 1],
     [2, 2, 2],
     [3, 3, 3]]
Y = [[4, 5, 6],
     [4, 5, 6],
     [4, 5, 6]]

Args:

args: Tensors with rank 1 indexing: Either 'xy' or 'ij' (optional, default: 'xy') * name: A name for the operation (optional).

Returns:

  • outputs: A list of N Tensors with rank N

Defined in tensorflow/python/ops/array_ops.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/meshgrid