Returns a list of tensors with the same shapes and contents as the input tensors. This op can be used to override the gradient for complicated functions. For example, suppose y = f(x) and we wish to apply a custom function g for backprop such that dx = g(dy). In Python, ```python with tf.get_defa
(scope *Scope, input []tf.Output)
| 24153 | // return [None, g(dy)] # Do not backprop to f(x). |
| 24154 | // ``` |
| 24155 | func IdentityN(scope *Scope, input []tf.Output) (output []tf.Output) { |
| 24156 | if scope.Err() != nil { |
| 24157 | return |
| 24158 | } |
| 24159 | opspec := tf.OpSpec{ |
| 24160 | Type: "IdentityN", |
| 24161 | Input: []tf.Input{ |
| 24162 | tf.OutputList(input), |
| 24163 | }, |
| 24164 | } |
| 24165 | op := scope.AddOperation(opspec) |
| 24166 | if scope.Err() != nil { |
| 24167 | return |
| 24168 | } |
| 24169 | var idx int |
| 24170 | var err error |
| 24171 | if output, idx, err = makeOutputList(op, idx, "output"); err != nil { |
| 24172 | scope.UpdateErr("IdentityN", err) |
| 24173 | return |
| 24174 | } |
| 24175 | return output |
| 24176 | } |
| 24177 | |
| 24178 | // Computes inverse hyperbolic sine of x element-wise. |
| 24179 | // |