lib/torch/nn/init.rb in torch-rb-0.3.7 vs lib/torch/nn/init.rb in torch-rb-0.4.0
- old
+ new
@@ -12,28 +12,14 @@
def normal!(tensor, mean: 0.0, std: 1.0)
_normal!(tensor, mean, std)
end
- def constant!(tensor, val)
- _constant!(tensor, val)
- end
-
- def ones!(tensor)
- _ones!(tensor)
- end
-
- def zeros!(tensor)
- _zeros!(tensor)
- end
-
- def eye!(tensor)
- _eye!(tensor)
- end
-
- def dirac!(tensor)
- _dirac!(tensor)
- end
+ alias_method :constant!, :_constant!
+ alias_method :ones!, :_ones!
+ alias_method :zeros!, :_zeros!
+ alias_method :eye!, :_eye!
+ alias_method :dirac!, :_dirac!
def xavier_uniform!(tensor, gain: 1.0)
_xavier_uniform!(tensor, gain)
end