MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MaxPoolOp

Method MaxPoolOp

tensorflow/compiler/tf2xla/kernels/pooling_ops.cc:153–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151class MaxPoolOp : public PoolingOp {
152 public:
153 MaxPoolOp(OpKernelConstruction* ctx, int num_spatial_dims)
154 : PoolingOp(ctx, /*num_spatial_dims=*/num_spatial_dims,
155 /*reduction_type=*/ctx->input_type(0)) {
156 string data_format_str;
157 OP_REQUIRES_OK(ctx, ctx->GetAttr("data_format", &data_format_str));
158 OP_REQUIRES(ctx, FormatFromString(data_format_str, &data_format_),
159 errors::InvalidArgument("Invalid data format"));
160 OP_REQUIRES(
161 ctx,
162 data_format_ != FORMAT_NCHW_VECT_C &&
163 data_format_ != FORMAT_NHWC_VECT_W,
164 errors::Unimplemented("XLA does not support the VECT_* data formats. "
165 "Returning unimplemented from MaxPool to keep "
166 "Tensorflow's intended optimized MaxPool here."));
167 }
168
169 void Compile(XlaOpKernelContext* ctx) override {
170 auto ksize_or_error = GetKernelSize(ctx);

Callers

nothing calls this directly

Calls 5

FormatFromStringFunction · 0.85
InvalidArgumentFunction · 0.85
UnimplementedFunction · 0.85
input_typeMethod · 0.45
GetAttrMethod · 0.45

Tested by

no test coverage detected