lib/torch/nn/module.rb in torch-rb-0.2.2 vs lib/torch/nn/module.rb in torch-rb-0.2.3
- old
+ new
@@ -222,15 +222,15 @@
_apply ->(t) { t.share_memory! }
end
def inspect
name = self.class.name.split("::").last
- if children.empty?
+ if named_children.empty?
"#{name}(#{extra_inspect})"
else
str = String.new
str << "#{name}(\n"
- children.each do |name, mod|
+ named_children.each do |name, mod|
str << " (#{name}): #{mod.inspect}\n"
end
str << ")"
end
end