T
- data type for output()
outputU
- data type for argmax()
output@Operator(group="nn") public final class MaxPoolWithArgmax<T extends Number,U extends Number> extends PrimitiveOp
The indices in `argmax` are flattened, so that a maximum value at position `[b, y, x, c]` becomes flattened index: `(y * width + x) * channels + c` if `include_batch_in_index` is False; `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True.
The indices returned are always in `[0, height) x [0, width)` before flattening, even if padding is involved and the mathematically correct answer is outside (either negative or too large). This is a bug, but fixing it is difficult to do in a safe backwards compatible way, especially due to flattening.
Modifier and Type | Class and Description |
---|---|
static class |
MaxPoolWithArgmax.Options
Optional attributes for
MaxPoolWithArgmax |
operation
Modifier and Type | Method and Description |
---|---|
Output<U> |
argmax()
4-D.
|
static <T extends Number,U extends Number> |
create(Scope scope,
Operand<T> input,
List<Long> ksize,
List<Long> strides,
Class<U> Targmax,
String padding,
MaxPoolWithArgmax.Options... options)
Factory method to create a class wrapping a new MaxPoolWithArgmax operation.
|
static <T extends Number> |
create(Scope scope,
Operand<T> input,
List<Long> ksize,
List<Long> strides,
String padding,
MaxPoolWithArgmax.Options... options)
Factory method to create a class wrapping a new MaxPoolWithArgmax operation using default output types.
|
static MaxPoolWithArgmax.Options |
includeBatchInIndex(Boolean includeBatchInIndex) |
Output<T> |
output()
The max pooled output tensor.
|
equals, hashCode, op, toString
public static <T extends Number,U extends Number> MaxPoolWithArgmax<T,U> create(Scope scope, Operand<T> input, List<Long> ksize, List<Long> strides, Class<U> Targmax, String padding, MaxPoolWithArgmax.Options... options)
scope
- current scopeinput
- 4-D with shape `[batch, height, width, channels]`. Input to pool over.ksize
- The size of the window for each dimension of the input tensor.strides
- The stride of the sliding window for each dimension of the
input tensor.Targmax
- padding
- The type of padding algorithm to use.options
- carries optional attributes valuespublic static <T extends Number> MaxPoolWithArgmax<T,Long> create(Scope scope, Operand<T> input, List<Long> ksize, List<Long> strides, String padding, MaxPoolWithArgmax.Options... options)
scope
- current scopeinput
- 4-D with shape `[batch, height, width, channels]`. Input to pool over.ksize
- The size of the window for each dimension of the input tensor.strides
- The stride of the sliding window for each dimension of the
input tensor.padding
- The type of padding algorithm to use.options
- carries optional attributes valuespublic static MaxPoolWithArgmax.Options includeBatchInIndex(Boolean includeBatchInIndex)
includeBatchInIndex
- Whether to include batch dimension in flattened index of `argmax`.Copyright © 2022. All rights reserved.