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

Function InitPoolOpKernelCache

oneflow/user/kernels/tf_pool_cpu_kernel.cpp:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29};
30
31std::shared_ptr<PoolOpKernelCache> InitPoolOpKernelCache(user_op::KernelCacheContext* ctx,
32 const int32_t& dim) {
33 const Shape& x_shape = ctx->TensorDesc4ArgNameAndIndex("x", 0)->shape();
34 const std::string& data_format = ctx->Attr<std::string>("data_format");
35 const std::string& padding = ctx->Attr<std::string>("padding");
36 const auto& padding_before = ctx->Attr<std::vector<int32_t>>("padding_before");
37 const auto& padding_after = ctx->Attr<std::vector<int32_t>>("padding_after");
38 const std::vector<int32_t>& pool_size = ctx->Attr<std::vector<int32_t>>("pool_size");
39 const std::vector<int32_t>& strides = ctx->Attr<std::vector<int32_t>>("strides");
40 const bool ceil_mode = ctx->Attr<bool>("ceil_mode");
41 Params3D params_3d = Params3D(dim, x_shape, data_format, padding, padding_before, padding_after,
42 pool_size, strides, ceil_mode);
43 std::shared_ptr<PoolOpKernelCache> state(new PoolOpKernelCache(params_3d));
44 return state;
45}
46
47template<typename T>
48struct PoolCpuKernelUtil {

Callers 12

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

Calls 3

Params3DClass · 0.85
shapeMethod · 0.45

Tested by

no test coverage detected