T
- data type for output()
output@Operator(group="train") public final class PreventGradient<T> extends PrimitiveOp implements Operand<T>
When executed in a graph, this op outputs its input tensor as-is.
When building ops to compute gradients, the TensorFlow gradient system will return an error when trying to lookup the gradient of this op, because no gradient must ever be registered for this function. This op exists to prevent subtle bugs from silently returning unimplemented gradients in some corner cases.
Modifier and Type | Class and Description |
---|---|
static class |
PreventGradient.Options
Optional attributes for
PreventGradient |
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T> PreventGradient<T> |
create(Scope scope,
Operand<T> input,
PreventGradient.Options... options)
Factory method to create a class wrapping a new PreventGradient operation.
|
static PreventGradient.Options |
message(String message) |
Output<T> |
output()
the same input tensor.
|
equals, hashCode, op, toString
public static <T> PreventGradient<T> create(Scope scope, Operand<T> input, PreventGradient.Options... options)
scope
- current scopeinput
- any tensor.options
- carries optional attributes valuespublic static PreventGradient.Options message(String message)
message
- Will be printed in the error when anyone tries to differentiate
this operation.public Output<T> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<T>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.