Optional
dtype: DtypeOptional
device: DeviceishOptional
requiresGrad: booleanPrivate
_devicePrivate
_dtypePrivate
_gradPrivate
_gradPrivate
_nodePrivate
_requiresPrivate
_shapePrivate
_stridesPrivate
isCalculates:
output = input + other * alpha
Gradient:
inputGrad = outputGrad; otherGrad = outputGrad
the other tensor whose shape is broadcastable with the input tensor
Optional
alpha: numberthe alpha value to multiply other
with
the output tensor
Calculates:
output = input + other * alpha
Gradient:
inputGrad = outputGrad; otherGrad = outputGrad
the other tensor whose shape is broadcastable with the input tensor
Optional
alpha: numberthe alpha value to multiply other
with
the output tensor
Alias for atan2
.
Calculates:
output = atan2(input, other)
Gradient:
inputGrad = outputGrad * other / (input * input + other * other); otherGrad = -outputGrad * input / (input * input + other * other)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = atan2(input, other)
Gradient:
inputGrad = outputGrad * other / (input * input + other * other); otherGrad = -outputGrad * input / (input * input + other * other)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = atan2(input, other)
Gradient:
inputGrad = outputGrad * other / (input * input + other * other); otherGrad = -outputGrad * input / (input * input + other * other)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Optional
gradient: TensorCalculates:
output = other >= 0 ? abs(input) : -abs(input)
Gradient:
var dir = other >= 0 ? (input >= 0 ? 1.0 : -1.0) : (input >= 0 ? -1.0 : 1.0); inputGrad = input == 0.0 ? 0.0 : outputGrad * dir; otherGrad = 0
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = other >= 0 ? abs(input) : -abs(input)
Gradient:
var dir = other >= 0 ? (input >= 0 ? 1.0 : -1.0) : (input >= 0 ? -1.0 : 1.0); inputGrad = input == 0.0 ? 0.0 : outputGrad * dir; otherGrad = 0
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = sqrt(input * input + other * other)
Gradient:
inputGrad = outputGrad * input / sqrt(input * input + other * other); otherGrad = outputGrad * other / sqrt(input * input + other * other)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = sqrt(input * input + other * other)
Gradient:
inputGrad = outputGrad * input / sqrt(input * input + other * other); otherGrad = outputGrad * other / sqrt(input * input + other * other)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = input * pow(2.0, other)
Gradient:
var out = pow(2.0, other); inputGrad = outputGrad * out; otherGrad = outputGrad * input * out * 0.6931471805599453
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = input * pow(2.0, other)
Gradient:
var out = pow(2.0, other); inputGrad = outputGrad * out; otherGrad = outputGrad * input * out * 0.6931471805599453
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = log(exp(input) + exp(other))
Gradient:
var ein = exp(input); var eoth = exp(other); var addeinv = outputGrad/(ein + eoth); inputGrad = addeinv * ein; otherGrad = addeinv * eoth
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = log2(exp2(input) + exp2(other))
Gradient:
var ein = exp2(input); var eoth = exp2(other); var sum_ein_eoth = ein + eoth; inputGrad = outputGrad * (ein / sum_ein_eoth); otherGrad = outputGrad * (eoth / sum_ein_eoth );
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = log2(exp2(input) + exp2(other))
Gradient:
var ein = exp2(input); var eoth = exp2(other); var sum_ein_eoth = ein + eoth; inputGrad = outputGrad * (ein / sum_ein_eoth); otherGrad = outputGrad * (eoth / sum_ein_eoth );
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = log(exp(input) + exp(other))
Gradient:
var ein = exp(input); var eoth = exp(other); var addeinv = outputGrad/(ein + eoth); inputGrad = addeinv * ein; otherGrad = addeinv * eoth
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = input >= 0 || fract(other) != 0 ? pow(input, other) :
pow(-input, other) * ((i32(other) & 1) != 0 ? -1f : 1f)
Gradient:
inputGrad = input >= 0 || fract(other) != 0 ? outputGrad * other * pow(input, other - 1.0) :
outputGrad * other * pow(-input, other - 1) * ((i32(other - 1) & 1) != 0 ? -1f : 1f);
otherGrad = outputGrad * pow(input, other) * log(input)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = input >= 0 || fract(other) != 0 ? pow(input, other) :
pow(-input, other) * ((i32(other) & 1) != 0 ? -1f : 1f)
Gradient:
inputGrad = input >= 0 || fract(other) != 0 ? outputGrad * other * pow(input, other - 1.0) :
outputGrad * other * pow(-input, other - 1) * ((i32(other - 1) & 1) != 0 ? -1f : 1f);
otherGrad = outputGrad * pow(input, other) * log(input)
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Rest
...additionalInputs: Tensor[]Rest
...additionalInputs: Tensor[]Calculates:
var inpi = input * 3.141592653589793; output = input == 0.0 ? 1.0 : sin(inpi) / inpi
Gradient:
var inpi = input * 3.141592653589793; inputGrad = input == 0.0 ? 0.0 : (outputGrad * 3.141592653589793 * (inpi*cos(inpi) - sin(inpi)) / (inpi*inpi))
the output tensor
Calculates:
var inpi = input * 3.141592653589793; output = input == 0.0 ? 1.0 : sin(inpi) / inpi
Gradient:
var inpi = input * 3.141592653589793; inputGrad = input == 0.0 ? 0.0 : (outputGrad * 3.141592653589793 * (inpi*cos(inpi) - sin(inpi)) / (inpi*inpi))
the output tensor
Calculates:
output = input - other * alpha
Gradient:
inputGrad = outputGrad; otherGrad = -outputGrad
the other tensor whose shape is broadcastable with the input tensor
Optional
alpha: numberthe alpha value to multiply other
with
the output tensor
Calculates:
output = input - other * alpha
Gradient:
inputGrad = outputGrad; otherGrad = -outputGrad
the other tensor whose shape is broadcastable with the input tensor
Optional
alpha: numberthe alpha value to multiply other
with
the output tensor
Alias for sub
.
Calculates:
output = input - other * alpha
Gradient:
inputGrad = outputGrad; otherGrad = -outputGrad
the other tensor whose shape is broadcastable with the input tensor
Optional
alpha: numberthe alpha value to multiply other
with
the output tensor
Calculates:
output = input == 0.0 ? 0.0 : input * log(other)
Gradient:
inputGrad = input == 0.0 ? 0.0 : outputGrad * log(other); otherGrad = input == 0.0 ? 0.0 : outputGrad * (input / other);
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Calculates:
output = input == 0.0 ? 0.0 : input * log(other)
Gradient:
inputGrad = input == 0.0 ? 0.0 : outputGrad * log(other); otherGrad = input == 0.0 ? 0.0 : outputGrad * (input / other);
the other tensor whose shape is broadcastable with the input tensor
the output tensor
Generated using TypeDoc
Calculates:
Gradient: