| 37 | std::vector<op_desc> operators() const { return {{"Softmax"}}; } |
| 38 | |
| 39 | instruction_ref parse(const op_desc& /*opd*/, |
| 40 | const tf_parser& /*parser*/, |
| 41 | tf_parser::node_info info, |
| 42 | std::vector<instruction_ref> args) const |
| 43 | { |
| 44 | int axis = -1; |
| 45 | auto num_dims = args[0]->get_shape().lens().size(); |
| 46 | if(contains(info.attributes, "axis")) |
| 47 | { |
| 48 | axis = static_cast<int>(info.attributes.at("axis").i()); |
| 49 | } |
| 50 | |
| 51 | axis = tune_axis(num_dims, axis, "tf_parse_softmax"); |
| 52 | |
| 53 | return info.add_instruction(make_op("softmax", {{"axis", axis}}), |
| 54 | info.make_contiguous(args[0])); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | } // namespace tf |
nothing calls this directly
no test coverage detected