How can I manually replicate dtype-converting an nn.module
?
Would the following be enough, or are there other items that need to be converted as well?
dtype = torch.float32
for buf in model.buffers():
buf.data = buf.data.to(dtype=dtype)
for param in model.parameters():
param.data = param.data.to(dtype=dtype)