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

Function _Relu6

express/NeuralNetWorkOp.cpp:447–455  ·  view source on GitHub ↗

Given an input value x, it computes Rectified Linear 6: min(max(x, 0), 6). Args: x: A variable. Returns: output: A variable with the same type as `x`. */

Source from the content-addressed store, hash-verified

445output: A variable with the same type as `x`.
446*/
447VARP _Relu6(VARP x, float minValue, float maxValue) {
448 std::unique_ptr<OpT> relu(new OpT);
449 relu->type = OpType_ReLU6;
450 relu->main.value = new Relu6T;
451 relu->main.type = OpParameter_Relu6;
452 relu->main.AsRelu6()->maxValue = maxValue;
453 relu->main.AsRelu6()->minValue = minValue;
454 return (Variable::create(Expr::create(relu.get(), {x})));
455}
456/*Given an input value x, it computes the output as x if x > 0 and slopes * x if x <= 0.
457Args:
458x: A variable, must be 4-D with NC4HW4 format.

Callers 15

_shrinkFunction · 0.85
quantizeMethod · 0.85
onExecuteMethod · 0.85
FuseTemplateOp.cppFile · 0.85
onExecuteMethod · 0.85
onExecuteMethod · 0.85
onExecuteMethod · 0.85
_activateFunction · 0.85

Calls 3

AsRelu6Method · 0.80
createFunction · 0.50
getMethod · 0.45

Tested by 5

runMethod · 0.68
makeComplexGraphFunction · 0.68
runMethod · 0.68
runMethod · 0.68
runMethod · 0.68