maix.nn.F

maix.nn.F module

You can use maix.nn.F to access this module with MaixPy
This module is generated from MaixPy and MaixCDK

Module

No module

Enum

Variable

Function

softmax

def softmax(tensor: maix.tensor.Tensor, replace: bool) -> maix.tensor.Tensor

Softmax, only support 1D tensor, multi-dimension tensor will be treated as 1D tensor

item description
param tensor: input tensor
replace: change input tensor data directly, if not, will create a new tensor
throw If arg error, will raise err.Exception error
return output tensor, if arg replace is true, return the arg tensor's address.
If not replace, return a new object, so In C++, you should delete it manually in this case!

C++ defination code:

tensor::Tensor *softmax(tensor::Tensor *tensor, bool replace)

Class