MathActivation.operations: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/math_activation.bend as MathActivation Lines 107-127 of stelliferous@0.0.2.0/math_activation.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/math_activation.bend&start_line=107&end_line=127 import Base # Operations per element, excluding the pass that applies them. def operations(activation: Activation) -> F32: match activation: case Identity{}: 0.0 # compare and select case ReLU{}: 2.0 case ReLU6{}: 4.0 # compare, multiply and select case LeakyReLU{slope}: 3.0 # 31 arithmetic, comparison, select and word instructions per eight lanes case Sigmoid{}: 3.875 # 34 per eight lanes: scaled numerator and positive-tail selection case SiLU{}: 4.25 # 54 per eight lanes case Tanh{}: 6.75 # add, relu6 and divide; hard_swish also multiplies case HardSigmoid{}: 6.0 case HardSwish{}: 7.0 # 62 per eight lanes: the PyTorch expression around the tanh case GELUTanh{}: 7.75 case Custom{operations}: operations Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=Activation