Fix cond_cat to not try to cast anything that doesn't have a 'to' function
This commit is contained in:
@@ -143,7 +143,7 @@ def cond_cat(c_list, device=None):
|
|||||||
for k in temp:
|
for k in temp:
|
||||||
conds = temp[k]
|
conds = temp[k]
|
||||||
out[k] = conds[0].concat(conds[1:])
|
out[k] = conds[0].concat(conds[1:])
|
||||||
if device is not None:
|
if device is not None and hasattr(out[k], 'to'):
|
||||||
out[k] = out[k].to(device)
|
out[k] = out[k].to(device)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|||||||
Reference in New Issue
Block a user