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.ops.ExtractVolumePatches

class mindspore.ops.ExtractVolumePatches(kernel_size, strides, padding)[source]

Extract patches from input and put them in the “depth” output dimension.

Parameters
  • kernel_size (Union[int, tuple[int], list[int]]) – A list of ints which’s length is 3 or 5. The size of the sliding window for each dimension of input. Must be: [1, 1, k_d, k_h, k_w] or [k_d, k_h, k_w]. If k_d = k_h = k_w, you can enter an integer.

  • strides (Union[int, tuple[int], list[int]]) – A list of ints which’s length is 3 or 5. How far the centers of two consecutive patches are in input. Must be: [1, 1, s_d, s_h, s_w] or [s_d, s_h, s_w]. If s_d = s_h = s_w, you can enter an integer.

  • padding (str) – A string from: “SAME”, “VALID”. The type of padding algorithm to use.

Inputs:
  • input_x (Tensor) - A Tensor. 5-D Tensor with shape (xn,xc,xd,xh,xw).

Outputs:

Tensor, has the same type as input. If padding is VALID, the shape is (xn,kdkhkwxc,1+(xdkd)/sd,1+(xhkh)/sh,1+(xwkw)/sw); if padding is SAME, the shape is (xn,kdkhkwxc,(xd+sd1)/sd,(xh+sh1)/sh,(xw+sw1)/sw).

Raises
  • TypeError – If kernel_size or strides is not a list, a tuple or an int.

  • TypeError – If input_x is not a tensor.

  • TypeError – If padding is not str.

  • ValueError – If the length of kernel_size is neither 3 nor 5 and kernel_size is not an integer.

  • ValueError – If the length of strides is neither 3 nor 5 and strides is not an integer.

  • ValueError – If padding is neither “VALID” nor “SAME”.

  • ValueError – If elements of kernel_size or strides are not positive integer.

  • ValueError – If input_x is not a tensor in dimension 5.

  • ValueError – If input_x’s shape has zero.

  • ValueError – If one of kernel_size or strides’ first two numbers is not 1.

  • ValueError – If padding = “VALID” and input - kernel_size is less than 0 in d, h or w dimension.

  • ValueError – If padding = “SAME” and padding_needed=((input_x+strides1)/strides1)strides+kernel_sizeinput is less than 0 in d, h or w dimension.

  • ValueError – If x_h is not 1 or x_w is not 1 and x_w + padding_needed - k_w - s_w is less than 0.

  • ValueError – If x_d * x_h * x_w is greater than 2048.

Supported Platforms:

Ascend CPU

Examples

>>> kernel_size = (1, 1, 2, 2, 2)
>>> strides = (1, 1, 1, 1, 1)
>>> padding = "VALID"
>>> input_x = P.Reshape()(Tensor(np.arange(1, 28), mstype.float16), (1, 1, 3, 3, 3))
>>> output_y = P.ExtractVolumePatches(kernel_size, strides, padding)(input_x)
>>> print(output_y.shape)
(1, 8, 2, 2, 2)