40 : _node(node), _input_name(input_name)
52void SqueezeGraphUpdate::input(
const SymbolTable *table)
const
55 _node->input(input_node);
65 if (node.input_size() != 1)
74 oops::UserExn(
"Squeeze: Unsupported 'axis' attribute", node.name());
82 assert(context !=
nullptr);
91 std::vector<int64_t> squeeze_dims;
102 auto tf_squeeze = graph->nodes()->create<
TFSqueeze>();
103 tf_squeeze->
name(node.name());
104 tf_squeeze->squeeze_dims(squeeze_dims);
107 tensor_names->
enroll(output_name, tf_squeeze);
109 auto update = std::make_unique<SqueezeGraphUpdate>(tf_squeeze,
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)
std::vector< int64_t > as_int64_list(const tensorflow::AttrValue_ListValue &lv)
const tensorflow::AttrValue_ListValue & get_list_attr(const tensorflow::NodeDef &node, const std::string &attr_name)
NodeName name(void) const