lib/torch/native/dispatcher.rb in torch-rb-0.1.5 vs lib/torch/native/dispatcher.rb in torch-rb-0.1.6
- old
+ new
@@ -16,10 +16,10 @@
class << self
def bind
functions = Generator.grouped_functions
bind_functions(::Torch, :define_singleton_method, functions[:torch])
bind_functions(::Torch::Tensor, :define_method, functions[:tensor])
- # NN functions are internal, so no need to bind
+ bind_functions(::Torch::NN, :define_singleton_method, functions[:nn])
end
def bind_functions(context, def_method, functions)
functions.group_by(&:ruby_name).sort_by { |g, _| g }.each do |name, funcs|
if def_method == :define_method