| 24 | }; |
| 25 | |
| 26 | std::shared_ptr<PoolOpKernelCache> CreatePoolOpKernelCache(user_op::KernelCacheContext* ctx, |
| 27 | const int32_t& dim) { |
| 28 | const Shape& x_shape = ctx->TensorDesc4ArgNameAndIndex("x", 0)->shape(); |
| 29 | const std::string& data_format = ctx->Attr<std::string>("data_format"); |
| 30 | const std::vector<int32_t>& padding = ctx->Attr<std::vector<int32_t>>("padding"); |
| 31 | const std::vector<int32_t>& kernel_size = ctx->Attr<std::vector<int32_t>>("kernel_size"); |
| 32 | const std::vector<int32_t>& stride = ctx->Attr<std::vector<int32_t>>("stride"); |
| 33 | const std::vector<int32_t>& dilation = ctx->Attr<std::vector<int32_t>>("dilation"); |
| 34 | const bool return_indices = ctx->Attr<bool>("return_indices"); |
| 35 | const bool ceil_mode = ctx->Attr<bool>("ceil_mode"); |
| 36 | |
| 37 | MaxPoolParams3D params_3d = MaxPoolParams3D(dim, x_shape, data_format, padding, kernel_size, |
| 38 | stride, dilation, return_indices, ceil_mode); |
| 39 | std::shared_ptr<PoolOpKernelCache> cache(new PoolOpKernelCache(params_3d)); |
| 40 | return cache; |
| 41 | } |
| 42 | |
| 43 | namespace { |
| 44 |
no test coverage detected