| 112 | } |
| 113 | |
| 114 | TensorND DynOutMallocPolicyImpl::alloc_output( |
| 115 | size_t /*id*/, DType dtype, const TensorShape& shape, void* /*user_data*/) { |
| 116 | auto ptr = megdnn_malloc(m_handle, dtype.size() * shape.total_nr_elems()); |
| 117 | return {ptr, TensorLayout{shape, dtype}}; |
| 118 | } |
| 119 | |
| 120 | void* DynOutMallocPolicyImpl::alloc_workspace(size_t sz, void* /*user_data*/) { |
| 121 | return megdnn_malloc(m_handle, sz); |