tensor loading iface
This commit is contained in:
parent
9722d96db2
commit
a34960a516
@ -152,6 +152,12 @@ func New(s string) (Model, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
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()
|
t := v.Type()
|
||||||
if t.Kind() == reflect.Pointer {
|
if t.Kind() == reflect.Pointer {
|
||||||
t, v = t.Elem(), v.Elem()
|
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
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user