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
To reduce the amount of redundant code, we could implement default mapper functions for these pytorch native operations. This default mapper function could be applied to a nn.Module ore nir.node when the framework specific mapper function does not supply the operation.
Description
Currently, the conversion to/from nir of the following pytorch function is handled individually in each pytorch-based framework:
torch.nn.Conv2d
torch.nn.Linear
In the future this might apply to other functions like:
torch.nn.Conv1d
and other convolution operationstorch.nn.AvgPool2d
and other average pooling operationstorch.nn.MaxPool2d
and other max pooling operationsThis is related to this issue in snntorch: jeshraghian/snntorch#304
Suggestion
To reduce the amount of redundant code, we could implement default mapper functions for these pytorch native operations. This default mapper function could be applied to a nn.Module ore nir.node when the framework specific mapper function does not supply the operation.
Changes for conversion from pytorch to NIR
The suggestion is to implement a default mapper function like
_extract_default_model
and call it if there is no
NIRNode
found by the framework dependentmodel_map
function provided: https://github.com/neuromorphs/NIRTorch/blob/main/nirtorch/to_nir.py#L70Changes for conversion from NIR to pytorch
Extend function
_switch_default_models
in https://github.com/neuromorphs/NIRTorch/blob/main/nirtorch/from_nir.py#L188The text was updated successfully, but these errors were encountered: