Pytorch-Memory-Utils icon indicating copy to clipboard operation
Pytorch-Memory-Utils copied to clipboard

Why **2

Open xuyan1115 opened this issue 7 years ago • 2 comments

Hi, I want to ask about your code: new_tensor_sizes = {(type(x), tuple(x.size()), ts_list.count(x.size()), np.prod(np.array(x.size()))*4/1000**2)

what's the means of **2 operation?

xuyan1115 avatar Oct 11 '18 05:10 xuyan1115

Hi. That's because we will get some number by MB and 1 MB is 1000**2 B (or 1024**2 B). You can take a look at this ~

Oldpan avatar Oct 12 '18 01:10 Oldpan

Hi,why *4 after np.array(x.size()))? did you assume the tensor is in format of FP32?

feifeibear avatar Mar 05 '21 08:03 feifeibear