返回與輸入具有相同形狀和內容的張量列表
用法
tf.raw_ops.IdentityN(
input, name=None
)
參數
-
input
Tensor
對象的列表。 -
name
操作的名稱(可選)。
返回
-
Tensor
對象的列表。具有與input
相同的類型。
張量。
此操作可用於覆蓋複雜函數的梯度。例如,假設 y = f(x),我們希望為反向傳播應用自定義函數 g,使得 dx = g(dy)。在 Python 中,
with tf.get_default_graph().gradient_override_map(
{'IdentityN':'OverrideGradientWithG'}):
y, _ = identity_n([f(x), x])
@tf.RegisterGradient('OverrideGradientWithG')
def ApplyG(op, dy, _):
return [None, g(dy)] # Do not backprop to f(x).
相關用法
- Python tf.raw_ops.Invert用法及代碼示例
- Python tf.raw_ops.IsInf用法及代碼示例
- Python tf.raw_ops.IsNan用法及代碼示例
- Python tf.raw_ops.InvertPermutation用法及代碼示例
- Python tf.raw_ops.IsFinite用法及代碼示例
- Python tf.raw_ops.Imag用法及代碼示例
- Python tf.raw_ops.InplaceAdd用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Bitcast用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.BatchMatMul用法及代碼示例
- Python tf.raw_ops.OneHot用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.GatherV2用法及代碼示例
- Python tf.raw_ops.Expm1用法及代碼示例
- Python tf.raw_ops.BitwiseAnd用法及代碼示例
- Python tf.raw_ops.UniqueWithCounts用法及代碼示例
- Python tf.raw_ops.DecodeGif用法及代碼示例
- Python tf.raw_ops.Size用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.IdentityN。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。