Python – tensorflow.math.invert_permutation()
TensorFlow是谷歌设计的开源Python库,用于开发机器学习模型和深度学习神经网络。
invert_permutation()是用来计算张量的反置换的。
语法: tensorflow.math.invert_permutation( x, name)
参数:
- x:它是一个一维张量。允许的dtypes是int32和int64。张量值应该在[0, 4]范围内。
- name(可选):它定义了该操作的名称
返回:它返回一个dtype为x的张量。
示例 1:
输出:
例子2:这个例子使用超出范围的值。它将引发InvalidArgument错误
输出: