MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / CreatePoolOpKernelCache

Function CreatePoolOpKernelCache

oneflow/user/kernels/max_pool_kernel.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24};
25
26std::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
43namespace {
44

Callers 6

InitOpKernelCacheMethod · 0.85
InitOpKernelCacheMethod · 0.85
InitOpKernelCacheMethod · 0.85
InitOpKernelCacheMethod · 0.85
InitOpKernelCacheMethod · 0.85
InitOpKernelCacheMethod · 0.85

Calls 3

MaxPoolParams3DClass · 0.85
shapeMethod · 0.45

Tested by

no test coverage detected