I am trying to figure out tf.function
converts a python function to a graph and calls it. And I have found that in tensorflow/python/ops/functional_ops.py:partitioned_call
,
op = graph.create_op(op_name, args, tout, name=op_name, attrs=op_attrs)
outputs = op.outputs
It seems that the graph is converted to an operation, but when I read the documentation of Operation
, it says
An
Operation
is a node in atf.Graph
that takes zero or moreTensor
objects as input, and produces zero or moreTensor
objects as output.
So I assume that Operation
should be a node in the graph. That makes me wonder what graph.create_op
really does. Is graph converted into a big Operation
here?