You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-83Lines changed: 27 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,18 @@ Supported layers:
18
18
Experimental support:
19
19
- RNN, LSTM, GRU (NLH layout is assumed)
20
20
- RNNCell, LSTMCell, GRUCell
21
-
- MultiheadAttention
21
+
-torch.nn.MultiheadAttention
22
22
- torchvision.ops.DeformConv2d
23
+
- visual transformers from [timm](https://github.com/huggingface/pytorch-image-models)
23
24
24
25
Requirements: Pytorch >= 1.1, torchvision >= 0.3
25
26
26
27
Thanks to @warmspringwinds for the initial version of script.
27
28
28
29
## Usage tips
29
30
30
-
- This tool doesn't take into account some of the `torch.nn.functional.*` and `tensor.*` operations. See `ptflops/pytorch_ops.py:FUNCTIONAL_MAPPING,TENSOR_OPS_MAPPING` to check supported ops.
31
+
- This tool doesn't take into account some of the `torch.nn.functional.*` and `tensor.*` operations. Therefore unsupported operations are
32
+
not contributing to the final complexity estimation. See `ptflops/pytorch_ops.py:FUNCTIONAL_MAPPING,TENSOR_OPS_MAPPING` to check supported ops.
31
33
-`ptflops` launches a given model on a random tensor and estimates amount of computations during inference. Complicated models can have several inputs, some of them could be optional. To construct non-trivial input one can use the `input_constructor` argument of the `get_model_complexity_info`. `input_constructor` is a function that takes the input spatial resolution as a tuple and returns a dict with named input arguments of the model. Next this dict would be passed to the model as a keyword arguments.
32
34
-`verbose` parameter allows to get information about modules that don't contribute to the final numbers.
33
35
-`ignore_modules` option forces `ptflops` to ignore the listed modules. This can be useful
@@ -72,84 +74,26 @@ If ptflops was useful for your paper or tech report, please cite me:
0 commit comments