Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/dnn/core/monkey_patch.rb
Instance Method Summary collapse
- #*(other) ⇒ Object
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #/(other) ⇒ Object
- #dnn__add ⇒ Object
- #dnn__div ⇒ Object
- #dnn__mul ⇒ Object
- #dnn__sub ⇒ Object
Instance Method Details
#*(other) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/dnn/core/monkey_patch.rb', line 21 def *(other) if other.is_a?(DNN::Tensor) || other.is_a?(DNN::Param) DNN::Layers::Mul.(DNN::Tensor.convert(self), other) else dnn__mul(other) end end |
#+(other) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/dnn/core/monkey_patch.rb', line 3 def +(other) if other.is_a?(DNN::Tensor) || other.is_a?(DNN::Param) DNN::Layers::Add.(DNN::Tensor.convert(self), other) else dnn__add(other) end end |
#-(other) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/dnn/core/monkey_patch.rb', line 12 def -(other) if other.is_a?(DNN::Tensor) || other.is_a?(DNN::Param) DNN::Layers::Sub.(DNN::Tensor.convert(self), other) else dnn__sub(other) end end |
#/(other) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/dnn/core/monkey_patch.rb', line 30 def /(other) if other.is_a?(DNN::Tensor) || other.is_a?(DNN::Param) DNN::Layers::Div.(DNN::Tensor.convert(self), other) else dnn__div(other) end end |
#dnn__add ⇒ Object
2 |
# File 'lib/dnn/core/monkey_patch.rb', line 2 alias dnn__add + |
#dnn__div ⇒ Object
29 |
# File 'lib/dnn/core/monkey_patch.rb', line 29 alias dnn__div / |
#dnn__mul ⇒ Object
20 |
# File 'lib/dnn/core/monkey_patch.rb', line 20 alias dnn__mul * |
#dnn__sub ⇒ Object
11 |
# File 'lib/dnn/core/monkey_patch.rb', line 11 alias dnn__sub - |