Hello. I have an exported model in .pth format. It is loaded in an Ordered Dictionary format, from which I would like to separate the numeric tensors (not the key values i.e. strings) and cast them to a different datatype, say int. However, upon calling dict.values(), I get a huge output, an excerpt of which is given below.
[-7.6345e-03, -4.4007e-03, -7.9214e-03, ..., -8.5340e-04,
6.4599e-04, -5.3076e-04]], device='cuda:0')}, 128: {'momentum_buffer': tensor([ 0.0129, -0.0025, -0.0054, -0.0146, -0.0153, 0.0049, 0.0010, -0.0075,
0.0060, -0.0038, 0.0023, 0.0005, -0.0026, 0.0036, -0.0013, 0.0051,
0.0073, 0.0064, -0.0050, 0.0048, 0.0024, -0.0002, 0.0051, 0.0052,
-0.0051, 0.0013, -0.0116, 0.0018, 0.0002, 0.0051, -0.0054, 0.0053,
-0.0014, 0.0086, -0.0128, 0.0101, -0.0145, 0.0103, 0.0042, -0.0055],
device='cuda:0')}}
I want to extract only the numeric values from this. How can I do that?