Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindspore.nn.AdaptiveMaxPool3d

class mindspore.nn.AdaptiveMaxPool3d(output_size, return_indices=False)[source]

Applies a 3D adaptive max pooling over an input signal composed of several input planes.

The output is of size (D,H,W), for any input size. The number of output features is equal to the number of input planes.

Parameters
  • output_size (Union[int, tuple]) – The target output size is (D,H,W). ouput_size can be a tuple with 3 elements, or a single D for (D,D,D). D, H and W can be int or None which means the output size is the same as that of the input.

  • return_indices (bool) – If return_indices is True, the indices of max value would be output. Default: False.

Inputs:
  • x (Tensor) - Tensor, has shape of (C,D,H,W) or (N,C,D,H,W) . The suppoerted dtypes are int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32 and float64 data type.

Outputs:
  • y (Tensor) - Tensor, has the same number of dims and data type as the x .

  • argmax (Tensor) - Tensor, the indices of the maximum values along with the outputs, has the same shape as y and a dtype of int32. Return this only when return_indices is True.

Raises
  • TypeError – If x is not a Tensor.

  • ValueError – If the dimensions number of x is not 4 or 5.

  • TypeError – If dtype of x is not int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32 or float64.

  • ValueError – If output_size is neither an int nor a tuple with shape (3,).

Supported Platforms:

GPU CPU

Examples

>>> x = Tensor(np.arange(0,36).reshape((1, 3, 3, 4)).astype(np.float32))
>>> output_size = (1, 1, 2)
>>> net = nn.AdaptiveMaxPool3d(output_size, True)
>>> output = net(x)
>>> print(output[0].asnumpy())
[[[[33. 35.]]]]
>>> print(output[1].asnumpy())
[[[[33 35]]]]