36 TFRsqrtGraphUpdate(
TFRsqrt *node,
TensorName &&name) : _node(node), _name(name) {}
45void TFRsqrtGraphUpdate::input(
const SymbolTable *table)
const
58 return node.input_size() == 1;
63 assert(context !=
nullptr);
70 auto tf_rsqrt = graph->nodes()->create<
TFRsqrt>();
71 tf_rsqrt->
name(node.name());
75 tensor_names->
enroll(output_name, tf_rsqrt);
78 auto tf_rsqrt_update = std::make_unique<TFRsqrtGraphUpdate>(tf_rsqrt,
TensorName(node.input(0)));
79 updates->
enroll(std::move(tf_rsqrt_update));
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.
bool validate(const tensorflow::NodeDef &) const override
void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override
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.
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