te.lang.cce.reduce_max(raw_tensor, axis, keepdims=False)
Calculates the maximum value based on a certain axis to reduce dimensions. The supported type is float16. The data types int8, uint8, int32 and float32 are converted to float16.
This API is defined in reduction_compute.py.
Parameter Description
- raw_tensor: input tensor, tvm.tensor type
- axis: axis for the reduce operation. The value range is [–d, d – 1]. The parameter d indicates the dimension of raw_tensor, int or list type
- keepdims: The default value is False, indicating that the length of the operation axis is 0 after the reduce operation. For example, if the original shape is (10, 10, 10) and keepdims=False, the shape after reduce is (10, 10). If this parameter is set to True, the length of the operation axis is set to 1 after the reduce operation. For example, if the original shape is (10, 10, 10) and keepdims=True, the shape after reduce is (10, 10, 1).
Return Value
res_tensor: tensor after the maximum value is obtained, tvm.tensor type
Calling Example
shape = (1024,1024) input_dtype = "float16" data = tvm.placeholder(shape, name="data", dtype=input_dtype) res = te.lang.cce.reduce_max(data, axis=1)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot