| 151 | class 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); |
nothing calls this directly
no test coverage detected