MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IdentityN

Function IdentityN

tensorflow/go/op/wrappers.go:24155–24176  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

24153// return [None, g(dy)] # Do not backprop to f(x).
24154// ```
24155func 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//

Callers 6

CreateSimpleIdentityNFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 4

makeOutputListFunction · 0.85
UpdateErrMethod · 0.80
ErrMethod · 0.45
AddOperationMethod · 0.45

Tested by 6

CreateSimpleIdentityNFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68