codegen/generate_functions.rb in torch-rb-0.12.2 vs codegen/generate_functions.rb in torch-rb-0.13.0
- old
+ new
@@ -413,10 +413,12 @@
"generator"
when "MemoryFormat"
"memoryformat"
when "Storage"
"storage"
+ when "Layout"
+ "layout"
else
raise "Unknown type: #{param[:type]} (#{function.name})"
end
if param[:optional]
@@ -443,11 +445,11 @@
def generate_dispatch_code(function, def_method, params, opt_index, remove_self)
# torch::empty sets requires_grad by at::empty doesn't
# https://github.com/pytorch/pytorch/issues/36455
prefix = remove_self ? "self." : (opt_index ? "torch::" : "at::")
- dispatch = function.dispatch_name
+ dispatch = nil # function.dispatch_name
unless dispatch
dispatch = function.base_name
dispatch += "_symint" if function.func.include?("SymInt")
dispatch += "_out" if function.out?
end
@@ -638,10 +640,10 @@
when /\ASymInt\[\d*\]\z/
"SymIntArrayRef"
when "int"
"int64_t"
when "SymInt"
- "c10::SymInt"
+ "SymInt"
when "float"
"double"
when "str"
"std::string"
when "Scalar", "Dimname", "bool", "ScalarType", "Layout", "Device", "Generator", "MemoryFormat", "Storage"