lib/torch/tensor.rb in torch-rb-0.2.2 vs lib/torch/tensor.rb in torch-rb-0.2.3
- old
+ new
@@ -191,11 +191,19 @@
else
raise Error, "Unsupported index type: #{index.class.name}"
end
end
- def random!(from = 0, to)
- _random__from_to(from, to)
+ # native functions overlap, so need to handle manually
+ def random!(*args)
+ case args.size
+ when 1
+ _random__to(*args)
+ when 2
+ _random__from_to(*args)
+ else
+ _random_(*args)
+ end
end
private
def copy_to(dst, src)