| 77 | } |
| 78 | |
| 79 | Node* CollectiveReduceNode(GraphDefBuilder* builder, Node* input, |
| 80 | const string& name, const string& device, |
| 81 | int instance_key) { |
| 82 | Node* collective_node = |
| 83 | ops::UnaryOp("CollectiveReduce", input, |
| 84 | builder->opts() |
| 85 | .WithName(name) |
| 86 | .WithDevice(device) |
| 87 | .WithAttr("T", DT_FLOAT) |
| 88 | .WithAttr("group_size", 2) |
| 89 | .WithAttr("group_key", 1) |
| 90 | .WithAttr("instance_key", instance_key) |
| 91 | .WithAttr("merge_op", "Add") |
| 92 | .WithAttr("final_op", "Id") |
| 93 | .WithAttr("subdiv_offsets", {1})); |
| 94 | return collective_node; |
| 95 | } |
| 96 | |
| 97 | // Initialize the following graph: |
| 98 | // |
no test coverage detected