I’m working with Tensorflow in Python. I notice that there is @tf_export(v1=[xxx])
decorator before many functions.
By reading source code of tf_export
, i found it records the custom name to _NAME_TO_SYMBOL_MAPPING during call. It seems provide a ways to rename function.
My questions:
@tf_export(
"sets.union", v1=["sets.union", "sets.set_union"])
@dispatch.add_dispatch_support
def set_union(a, b, validate_indices=True):
According to my understanding:
-
Python Decorator(tf_export) will is invoked when I really invoke tf.set_union. If i don’t invoke tf.set_union,
tf_export
doesn’t be invoked. -
Because [1], why i can use
tf.sets.union
directly ?
Could somebody explain? thks !
user25465481 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.