tensor loading iface
This commit is contained in:
parent
8ab13e4d3e
commit
3c95c21ddf
@ -152,6 +152,12 @@ func New(s string) (Model, error) {
|
||||
}
|
||||
|
||||
func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
||||
var iface bool
|
||||
if v.Kind() == reflect.Interface {
|
||||
iface = true
|
||||
v = v.Elem()
|
||||
}
|
||||
|
||||
t := v.Type()
|
||||
if t.Kind() == reflect.Pointer {
|
||||
t, v = t.Elem(), v.Elem()
|
||||
@ -230,6 +236,10 @@ func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
||||
}
|
||||
}
|
||||
|
||||
if iface {
|
||||
return v.Addr()
|
||||
}
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user