MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / parse

Method parse

src/tf/parse_reshape.cpp:38–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 std::vector<op_desc> operators() const { return {{"Reshape"}}; }
37
38 instruction_ref parse(const op_desc& /*opd*/,
39 const tf_parser& /*parser*/,
40 const tf_parser::node_info& info,
41 std::vector<instruction_ref> args) const
42 {
43 if(args.size() != 2)
44 MIGRAPHX_THROW("reshape needs 2 arguments (input, new_shape)");
45 auto s = args[1]->eval();
46 std::vector<int64_t> dims;
47 s.visit([&](auto v) { copy(v, std::back_inserter(dims)); });
48 return info.add_instruction(make_op("reshape", {{"dims", dims}}), args[0]);
49 }
50};
51
52} // namespace tf

Callers

nothing calls this directly

Calls 6

copyFunction · 0.50
make_opFunction · 0.50
sizeMethod · 0.45
evalMethod · 0.45
visitMethod · 0.45
add_instructionMethod · 0.45

Tested by

no test coverage detected