Helper to construct a NodeDef.
| 46 | |
| 47 | // Helper to construct a NodeDef. |
| 48 | NodeDef NDef(StringPiece name, StringPiece op, gtl::ArraySlice<string> inputs, |
| 49 | gtl::ArraySlice<std::pair<string, FDH::AttrValueWrapper>> attrs, |
| 50 | const string& device) { |
| 51 | NodeDef n; |
| 52 | n.set_name(string(name)); |
| 53 | n.set_op(string(op)); |
| 54 | for (const auto& in : inputs) n.add_input(in); |
| 55 | n.set_device(device); |
| 56 | for (auto na : attrs) n.mutable_attr()->insert({na.first, na.second.proto}); |
| 57 | return n; |
| 58 | } |
| 59 | |
| 60 | FunctionDef NonZero() { |
| 61 | return FDH::Define( |
no test coverage detected