lib/torch.rb in torch-rb-0.2.7 vs lib/torch.rb in torch-rb-0.3.0
- old
+ new
@@ -468,14 +468,10 @@
when true, false
IValue.from_bool(obj)
when nil
IValue.new
when Array
- if obj.all? { |v| v.is_a?(Tensor) }
- IValue.from_list(obj.map { |v| IValue.from_tensor(v) })
- else
- raise Error, "Unknown list type"
- end
+ IValue.from_list(obj.map { |v| to_ivalue(v) })
else
raise Error, "Unknown type: #{obj.class.name}"
end
end