//clika-runtime/io.clika.runtime/Ops/add
add
[common]
fun add(input: Tensor, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY): Tensor
add(input: Tensor, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY): the add operator. Adds other (scaled) to input elementwise. Broadcasting and type promotion, the contract every binary op on this surface shares: operand shapes broadcast per the standard rules (trailing dims align; a 1 stretches), and dtypes promote to the dominant operand dtype per the promotion lattice (a scalar other keeps its weak kind; an integer literal with an integer tensor stays integral, a double promotes weak-float). The other ops below state "broadcasts and promotes as add" instead of restating this.
[common]
fun add(input: Tensor, other: Double, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY): Tensor
add(input: Tensor, other: Double, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY): the number form of add, other as a scalar.
[common]
fun add(input: Double, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY): Tensor
add(input: Double, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY): the add operator. Scalar-LHS . input keeps its kind: an integer scalar with an integer tensor stays integral (weak-int promotion); a double promotes weak-float. The parameter set mirrors the tensor-first form: alpha scales the TENSOR operand other, activation applies to the result.