pytorch_modelsize icon indicating copy to clipboard operation
pytorch_modelsize copied to clipboard

Half precision implementation

Open je-santos opened this issue 5 years ago • 1 comments

Hi Jacob,

I tried to estimate the size of my model that uses half precision without any luck. I changed line 34 to HalfTensor, but got the following message:

RuntimeError: "unfolded3d_copy_cpu" not implemented for 'Half'

Do you know how can I achieve this?

Thanks for your great work.

-Javier

je-santos avatar Jan 26 '20 16:01 je-santos

I haven't worked with the HalfTensor structure before, so I'm guessing here. The only copy happening in this tool is copying some_tensor.size() to CPU as a numpy array. Are even the size() results stored as HalfTensor?

If so, swapping out .size() for .shape in the get_output_sizes() method might do the trick.

jacobkimmel avatar Jun 25 '20 17:06 jacobkimmel