37 : _node(node), _input_name(input_name)
49void ShapeGraphUpdate::input(
const SymbolTable *table)
const
52 _node->input(input_node);
62 if (node.input_size() != 1)
70 assert(context !=
nullptr);
77 auto tf_shape = graph->nodes()->create<
TFShape>();
78 tf_shape->
name(node.name());
84 assert(dtype == loco::DataType::S32);
86 tf_shape->dtype(dtype);
91 tf_shape->dtype(loco::DataType::S32);
95 tensor_names->
enroll(output_name, tf_shape);
97 auto update = std::make_unique<ShapeGraphUpdate>(tf_shape,
TensorName(node.input(0)));
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 override
bool validate(const tensorflow::NodeDef &) 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.
CircleInput * input_node(loco::Graph *g, const loco::GraphInputIndex &index)
Find a Pull node with a given input index.
FeatureShapeUpdater update(loco::FeatureShape &feature_shape)
bool has_attrs(const tensorflow::NodeDef &node, const std::vector< std::string > &attr_names)
tensorflow::DataType get_datatype_attr(const tensorflow::NodeDef &node, const std::string &attr_name)
loco::DataType as_loco_datatype(const tensorflow::DataType dtype)
NodeName name(void) const