facebookresearch / detr

End-to-End Object Detection with Transformers
Apache License 2.0
13.09k stars 2.37k forks source link

update position encoding to make detr torch fx traceable #531

Open inisis opened 1 year ago

inisis commented 1 year ago

update position encoding to make detr torch fx traceable

inisis commented 1 year ago

without modification, using torch fx to trace detr will fail. image this is a problem related to torch arange fucntion, and a workaround is to warp it, image and replace torch.arange with torch_arange. image after this, detr can be traced by torch fx