smaug.math

smaug.math.add(tensor_a, tensor_b, name='add')

Elementwise addition.

If the inputs have different shapes, broadcasting is used to to make the shapes compatible.

Parameters
  • tensor_a – First input tensor.

  • tensor_b – Second input tensor.

  • name – Name of the operator.

Returns

A tensor with the same shape as the inputs (or broadcast inputs).

smaug.math.mul(tensor_a, tensor_b, name='mul')

Elementwise multiplication.

If the inputs have different shapes, broadcasting is used to to make the shapes compatible.

Parameters
  • tensor_a – First input tensor.

  • tensor_b – Second input tensor.

  • name – Name of the operator.

Returns

A tensor with the same shape as the inputs (or broadcast inputs).

smaug.math.less(tensor_a, tensor_b, name='less')

Returns the truth value of (tensor_a < tensor_b) element-wise.

If the inputs have different shapes, broadcasting is used to to make the shapes compatible.

smaug.math.less_equal(tensor_a, tensor_b, name='less_equal')

Returns the truth value of (tensor_a <= tensor_b) element-wise.

If the inputs have different shapes, broadcasting is used to to make the shapes compatible.

smaug.math.greater(tensor_a, tensor_b, name='great')

Returns the truth value of (tensor_a > tensor_b) element-wise.

If the inputs have different shapes, broadcasting is used to to make the shapes compatible.

smaug.math.greater_equal(tensor_a, tensor_b, name='great_equal')

Returns the truth value of (tensor_a >= tensor_b) element-wise.

If the inputs have different shapes, broadcasting is used to to make the shapes compatible.