RoIAlign.pytorch icon indicating copy to clipboard operation
RoIAlign.pytorch copied to clipboard

why can not use float64

Open wu-zhonghua opened this issue 6 years ago • 1 comments

I have debugged the code for about ten years. Finally, I found cannot use dtype of the box as float64.

WHY??????????????????????????????????????????????

I think this code is a little bit stupid.

wu-zhonghua avatar Oct 14 '18 13:10 wu-zhonghua

Because THFloatTensor and THCudaTensor is float32, THDoubleTensor and THCudaDoubleTensor is float64.

The type of box is defined as THFloatTensor or THCudaTensor in https://github.com/longcw/RoIAlign.pytorch/blob/master/roi_align/src/crop_and_resize.h#L3

Actually, I don't know why you need ten years to find such an error :) The proper way is to raise an exception if you are using a THDoubleTensor as the input which only accepts THFloatTensor.

longcw avatar Oct 14 '18 14:10 longcw