廣播參數以在N-D 網格上進行評估。
用法
tf.meshgrid(
*args, **kwargs
)
參數
-
*args
Tensor
排名為 1。 -
**kwargs
- 索引:'xy' 或 'ij'(可選,默認值:'xy')。
- name:操作的名稱(可選)。
返回
-
outputs
NTensor
的列表,排名為 N。
拋出
-
TypeError
當沒有傳遞關鍵字參數(kwargs)時。 -
ValueError
當索引關鍵字參數不是xy
或ij
之一時。
給定 N 個一維坐標數組 *args
,返回 N-D 坐標數組的列表 outputs
,用於評估 N-D 網格上的表達式。
注意:
meshgrid
支持笛卡爾 ('xy') 和矩陣 ('ij') 索引約定。當indexing
參數設置為'xy'(默認值)時,交換前兩個維度的廣播指令。
例子:
使用張量調用X, Y = meshgrid(x, y)
x = [1, 2, 3]
y = [4, 5, 6]
X, Y = tf.meshgrid(x, y)
# X = [[1, 2, 3],
# [1, 2, 3],
# [1, 2, 3]]
# Y = [[4, 4, 4],
# [5, 5, 5],
# [6, 6, 6]]
相關用法
- Python tf.math.special.fresnel_cos用法及代碼示例
- Python tf.math.polyval用法及代碼示例
- Python tf.math.is_finite用法及代碼示例
- Python tf.math.special.bessel_k0e用法及代碼示例
- Python tf.math.acosh用法及代碼示例
- Python tf.math.invert_permutation用法及代碼示例
- Python tf.math.segment_prod用法及代碼示例
- Python tf.math.bincount用法及代碼示例
- Python tf.math.bessel_i0e用法及代碼示例
- Python tf.math.unsorted_segment_min用法及代碼示例
- Python tf.math.conj用法及代碼示例
- Python tf.math.scalar_mul用法及代碼示例
- Python tf.math.zero_fraction用法及代碼示例
- Python tf.math.reduce_max用法及代碼示例
- Python tf.math.special.fresnel_sin用法及代碼示例
- Python tf.math.segment_mean用法及代碼示例
- Python tf.math.xlog1py用法及代碼示例
- Python tf.math.less_equal用法及代碼示例
- Python tf.mlir.experimental.convert_function用法及代碼示例
- Python tf.math.reduce_min用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.meshgrid。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。