I got 'dict' object has no attribute 'to'
hwopark opened this issue · 1 comments
hwopark commented
When I run the code for ASV examples, I got error ('dict' object has no attribute 'to) because of inputs is dict of tensors.
Are there any alternatives?
Line 237 in 4226ea8
sinhat98 commented
@hwopark
Sorry for the delay in replying.
The code contains a bug as you have pointed out.
Please use the following function
def to_device(inputs: dict, decice: str = 'cuda') -> dict:.
for k, v in inputs.items():
if isinstance(v, torch.Tensor):.
inputs[k] = v.to(device)
return inputs