check_and_init_5hdc_reduce_support
Description
Verifies the support of the reduce function when the tensor format is 5HD.
Prototype
def check_and_init_5hdc_reduce_support(input_tensor, axis)
Parameters
Parameter |
Description |
|---|---|
input_tensor |
Tensor to check. |
axis |
A list of ints, for the axes. |
Returns
True if the reduce function is supported; False otherwise.
Restrictions
If input_tensor is in 5HD format, axis is 1 or 4, data type is float16, but ori_shape or ori_format is not configured, the message "RuntimeError" is thrown.
Example
from tbe.common.utils import para_check
input_tensor = {}
input_tensor["format"] = "NC1HWC0"
input_tensor["dtype"] = "float16"
input_tensor["ori_shape"] = (32, 64, 64, 3)
input_tensor["ori_format"] = "NHWC"
para_check.check_and_init_5hdc_reduce_support(input_tensor, [1,4])
Checks whether the 5HD input_tensor supports the reduce function. Returns True, indicating supported.
Parent topic: Operator Argument Verification