abstract struct Number
inherits Value
#
The top-level number type.
Included modules
Comparable
Steppable
Methods#
#*(other : Tensor)
#
(other : Tensor)
Multiplies a Tensor
with a number. The number is broadcasted across
all elements of the Tensor
.
Arguments#
Examples#
a = [1, 2, 3].to_tensor
3 * a # => [3, 6, 9]
#**(other : Tensor)
#
(other : Tensor)
Raises a number to a Tensor
. The number is broadcasted across
all elements of the Tensor
.
Arguments#
Examples#
a = [1, 2, 3].to_tensor
2 ** a # => [2, 4, 8]
#+(other : Tensor)
#
(other : Tensor)
Adds a Tensor
to a number. The number is broadcasted across
all elements of the Tensor
.
Arguments#
Examples#
a = [1, 2, 3].to_tensor
3 + a # => [4, 5, 6]