| 52 | namespace test { |
| 53 | |
| 54 | inline void SetOutputAttrs(OpKernelContext::Params* params, |
| 55 | std::vector<AllocatorAttributes>* attrs) { |
| 56 | attrs->clear(); |
| 57 | for (int index = 0; index < params->op_kernel->num_outputs(); index++) { |
| 58 | AllocatorAttributes attr; |
| 59 | const bool on_host = |
| 60 | (params->op_kernel->output_memory_types()[index] == HOST_MEMORY); |
| 61 | attr.set_on_host(on_host); |
| 62 | attrs->push_back(attr); |
| 63 | } |
| 64 | params->output_attr_array = gtl::vector_as_array(attrs); |
| 65 | } |
| 66 | |
| 67 | } // namespace test |
| 68 |
no test coverage detected