32class TFIdentityGraphUpdate final :
public GraphUpdate
35 TFIdentityGraphUpdate(
TFIdentity *node,
const std::vector<TensorName> &names)
36 : _node(node), _names(names)
44 const std::vector<TensorName> _names;
47void TFIdentityGraphUpdate::input(
const SymbolTable *tensor_names)
const
49 for (
auto &name : _names)
63 if (node.input_size() < 1)
77 auto identity_node = graph->nodes()->create<
TFIdentity>();
78 identity_node->
name(node.name());
82 tensor_names->
enroll(output_name, identity_node);
86 std::vector<TensorName> names;
87 for (
int i = 0; i < node.input_size(); ++i)
91 auto update = std::make_unique<TFIdentityGraphUpdate>(identity_node, names);
Logical unit of computation.
Class to store context to build loco graph IR from TensorFlow.
SymbolTable * tensor_names()
Interface to connect the graph.
virtual void input(const SymbolTable *) const =0
Do the graph input connections using the SymbolTable.
void build(const tensorflow::NodeDef &, GraphBuilderContext *) const final
bool validate(const tensorflow::NodeDef &) const final
Class to store and query loco::Node* with string name key.
void enroll(const TensorName &tensor_name, loco::Node *node)
Registers a name with corresponding loco::Node *.
loco::Node * node(const TensorName &tensor_name) const
Queries enrolled(registered) with name and return node if found Will throw runtime_error if not found...
Class to store GraphUpdate objects.
void enroll(std::unique_ptr< GraphUpdate > &&update)
Registers GraphUpdate objects.
FeatureShapeUpdater update(loco::FeatureShape &feature_shape)
Option< std::string > target(optname("--target"), overview("select target language to emit for given architecture." "Valid values are '" NNC_TARGET_ARM_CPP "', '" NNC_TARGET_X86_CPP "', '" NNC_TARGET_ARM_GPU_CPP "', '" NNC_TARGET_INTERPRETER "'"), std::string(), optional(false), optvalues(NNC_TARGET_ARM_CPP "," NNC_TARGET_X86_CPP "," NNC_TARGET_ARM_GPU_CPP "," NNC_TARGET_INTERPRETER), nullptr, separators("="))
NodeName name(void) const