Python wrappers
Public Python APIs implemented by this engine symbol.Build N broadcast coordinate grids from N 1-D input tensors.
Given inputs with lengths
, produces N output tensors all of the same
rank-N shape; the -th output broadcasts across every axis
except its "carry" axis, where it varies. This is the
multi-dimensional analogue of NumPy's np.meshgrid.
Math
For ij indexing:
See Also
Concat : Stack the resulting grids along a new leading axis.
Parameters
xsvector<TensorImplPtr>One or more 1-D input tensors. All must share the same dtype and device.
indexing_xyboolAxis convention for the first two inputs: *
false — "ij" (matrix) indexing. Output i varies along axis i; output shape is (L_0, L_1, ..., L_{N-1}). * true — "xy" (Cartesian) indexing. Output 0 varies along axis 1 (x) and output 1 varies along axis 0 (y); outputs i >= 2 follow the ij convention. Output shape is (L_1, L_0, L_2, ..., L_{N-1}).Returns
vector<TensorImplPtr>N coordinate grids, one per input, each of rank N.
Notes
Backward sums each output gradient over every axis except the carry axis to recover the gradient w.r.t. the corresponding 1-D input. All inputs must be 1-D; mismatched ranks raise.
Examples
>>> X, Y = meshgrid([x, y], indexing_xy=true) // 'xy' convention
>>> X.shape == (len(y), len(x))
True