Usage: Calculate Params and FLOPs via [THOP](https://github.com/Lyken17/pytorch-OpCounter) Necessarity: from thop import profile from thop import clever_format :param model: :param input_tensor: :return:
(model, input_tensor)
| 73 | |
| 74 | |
| 75 | def CalParams(model, input_tensor): |
| 76 | """ |
| 77 | Usage: |
| 78 | Calculate Params and FLOPs via [THOP](https://github.com/Lyken17/pytorch-OpCounter) |
| 79 | Necessarity: |
| 80 | from thop import profile |
| 81 | from thop import clever_format |
| 82 | :param model: |
| 83 | :param input_tensor: |
| 84 | :return: |
| 85 | """ |
| 86 | flops, params = profile(model, inputs=(input_tensor,)) |
| 87 | flops, params = clever_format([flops, params], "%.3f") |
| 88 | print('[Statistics Information]\nFLOPs: {}\nParams: {}'.format(flops, params)) |
| 89 | |
| 90 | def one_hot_encoder(input_tensor,dataset,n_classes = None): |
| 91 | tensor_list = [] |
nothing calls this directly
no outgoing calls
no test coverage detected