lib/torch/native/parser.rb in torch-rb-0.3.2 vs lib/torch/native/parser.rb in torch-rb-0.3.3

- old
+ new

@@ -81,10 +81,12 @@ if k == "reduction" v.is_a?(String) else v.is_a?(Integer) end + when "int?" + v.is_a?(Integer) || v.nil? when "float" v.is_a?(Numeric) when /int\[.*\]/ if v.is_a?(Integer) size = t[4..-2] @@ -124,12 +126,14 @@ if candidates.size != 1 raise Error, "This should never happen. Please report a bug with #{@name}." end func = candidates.first + args = func.args.map { |a| final_values[a[:name]] } + args << TensorOptions.new.dtype(6) if func.tensor_options { name: func.cpp_name, - args: func.args.map { |a| final_values[a[:name]] } + args: args } end end end end