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

Function MaxPool

tensorflow/compiler/xla/client/lib/pooling.cc:133–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131} // namespace
132
133XlaOp MaxPool(XlaOp operand, absl::Span<const int64> kernel_size,
134 absl::Span<const int64> stride, Padding padding,
135 const TensorFormat& data_format) {
136 XlaBuilder* b = operand.builder();
137 return b->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
138 TF_ASSIGN_OR_RETURN(Shape operand_shape, b->GetShape(operand));
139 PrimitiveType dtype = operand_shape.element_type();
140 auto max_computation = CreateScalarMaxComputation(dtype, b);
141 auto init_value = MinValue(b, dtype);
142 return ReduceWindow(operand, init_value, max_computation, kernel_size,
143 stride, padding);
144 });
145}
146
147XlaOp AvgPool(XlaOp operand, absl::Span<const int64> kernel_size,
148 absl::Span<const int64> stride,

Callers 5

XLA_TEST_FFunction · 0.70
CompileMethod · 0.50
CompileMethod · 0.50
TEST_FFunction · 0.50
TEST_FFunction · 0.50

Calls 6

MinValueFunction · 0.85
ReduceWindowFunction · 0.85
ReportErrorOrReturnMethod · 0.80
builderMethod · 0.45
element_typeMethod · 0.45

Tested by 3

XLA_TEST_FFunction · 0.56
TEST_FFunction · 0.40
TEST_FFunction · 0.40