mindspore.ops.AdaptiveMaxPool3D
- class mindspore.ops.AdaptiveMaxPool3D[源代码]
三维自适应最大值池化。
更多参考详见
mindspore.ops.adaptive_max_pool3d()
。- 支持平台:
GPU
CPU
样例:
>>> class AdaptiveMaxPool3DNet(nn.Cell): ... def __init__(self): ... super(AdaptiveMaxPool3DNet, self).__init__() ... self.adaptive_max_pool_3d = ops.AdaptiveMaxPool3D() ... def construct(self, x_, output_size_): ... return self.adaptive_max_pool_3d(x_, output_size_) >>> x = np.arange(0,36).reshape((1, 3, 3, 4)).astype(np.float32) >>> output_size = np.array([1, 1, 2], dtype=np.int32) >>> net = AdaptiveMaxPool3DNet() >>> output = net(Tensor(x), Tensor(output_size)) >>> print(output[0].asnumpy()) [[[[33. 35.]]]] >>> print(output[1].asnumpy()) [[[[33 35]]]]