tf.no_gradient
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Specifies that ops of type op_type
is not differentiable.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.NoGradient
, tf.compat.v1.NotDifferentiable
, tf.compat.v1.no_gradient
tf.no_gradient(
op_type: str
) -> None
This function should not be used for operations that have a
well-defined gradient that is not yet implemented.
This function is only used when defining a new op type. It may be
used for ops such as tf.size()
that are not differentiable. For
example:
tf.no_gradient("Size")
The gradient computed for 'op_type' will then propagate zeros.
For ops that have a well-defined gradient but are not yet implemented,
no declaration should be made, and an error must be thrown if
an attempt to request its gradient is made.
Args |
op_type
|
The string type of an operation. This corresponds to the
OpDef.name field for the proto that defines the operation.
|
Raises |
TypeError
|
If op_type is not a string.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]