tf.compat.v1.keras.backend.name_scope
Stay organized with collections
Save and categorize content based on your preferences.
A context manager for use when defining a Python op.
tf.compat.v1.keras.backend.name_scope(
name, default_name=None, values=None
)
This context manager validates that the given values
are from the
same graph, makes that graph the default graph, and pushes a
name scope in that graph (see
tf.Graph.name_scope
for more details on that).
For example, to define a new Python op called my_op
:
def my_op(a, b, c, name=None):
with tf.name_scope(name, "MyOp", [a, b, c]) as scope:
a = tf.convert_to_tensor(a, name="a")
b = tf.convert_to_tensor(b, name="b")
c = tf.convert_to_tensor(c, name="c")
# Define some computation that uses `a`, `b`, and `c`.
return foo_op(..., name=scope)
Args |
name
|
The name argument that is passed to the op function.
|
default_name
|
The default name to use if the name argument is None .
|
values
|
The list of Tensor arguments that are passed to the op function.
|
Raises |
TypeError
|
if default_name is passed in but not a string.
|
Methods
__enter__
View source
__enter__()
__exit__
View source
__exit__(
*exc_info
)
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 2021-08-16 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 2021-08-16 UTC."],[],[]]