* @brief Reset the outputs held in the workspace, releasing the current memory and setting the * effective batch size to 0 for every output. */
| 74 | * effective batch size to 0 for every output. |
| 75 | */ |
| 76 | void ClearOutputs(Workspace &ws, const OpSpec &spec) { |
| 77 | for (int i = 0; i < spec.NumOutput(); i++) { |
| 78 | if (ws.template OutputIsType<CPUBackend>(i)) { |
| 79 | ws.template Output<CPUBackend>(i).Reset(); |
| 80 | } else { |
| 81 | ws.template Output<GPUBackend>(i).Reset(); |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | } // namespace |
| 87 |