facebookresearch / ClassyVision

An end-to-end PyTorch framework for image and video classification
https://classyvision.ai
MIT License
1.59k stars 278 forks source link

update profiler to support multiple positional inputs #663

Closed stephenyan1231 closed 3 years ago

stephenyan1231 commented 3 years ago

Summary: Currently, when profiler computes flops/activation for individual modules, it assume the forward function takes a single position argument def forward(self, x): ....

In some modules, such as the MatMul module used in visual transformer (https://fburl.com/diffusion/0tubwixm), the forward function takes more thane one arguments def forward(self, A, B): ....

Therefore, this diff updates the profiler to support multiple positional inputs in the forward function.

Differential Revision: D25214757

facebook-github-bot commented 3 years ago

This pull request was exported from Phabricator. Differential Revision: D25214757

facebook-github-bot commented 3 years ago

This pull request has been merged in facebookresearch/ClassyVision@0673482cb41683c72d0630b4765122cccef074b9.