MCPcopy Create free account
hub / github.com/alibaba/MNN / _Softmax

Function _Softmax

express/NeuralNetWorkOp.cpp:479–486  ·  view source on GitHub ↗

Computes softmax activations. Args: logits: A non-empty variable. Must be Halide_Type_Float. axis: The dimension softmax would be performed on. The default is -1 which indicates the last dimension. Returns: output: A variable with the same type as `logits`. */

Source from the content-addressed store, hash-verified

477output: A variable with the same type as `logits`.
478*/
479VARP _Softmax(VARP logits, int axis) {
480 std::unique_ptr<OpT> softmax(new OpT);
481 softmax->type = OpType_Softmax;
482 softmax->main.type = OpParameter_Axis;
483 softmax->main.value = new AxisT;
484 softmax->main.AsAxis()->axis = axis;
485 return (Variable::create(Expr::create(softmax.get(), {logits})));
486}
487/*Computes softplus: log(exp(features) + 1).
488Args:
489features: A variable. Must be Halide_Type_Float.

Callers 15

onExecuteMethod · 0.85
onExecuteMethod · 0.85
onForwardMethod · 0.85
onForwardMethod · 0.85
onForwardMethod · 0.85
onForwardMethod · 0.85
onForwardMethod · 0.85
_testFunction · 0.85
_trainFunction · 0.85
onForwardMethod · 0.85
_DistillLossFunction · 0.85
mobileNetV1ExprFunction · 0.85

Calls 3

AsAxisMethod · 0.80
createFunction · 0.50
getMethod · 0.45

Tested by 5

_mobileNetV1ExprFunction · 0.68
_mobileNetV1ExprMethod · 0.68
runMethod · 0.68
runMethod · 0.68
_computeAttentionExprFunction · 0.68