Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[quant][eagermode] Add support for sigmoid module #45884

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/quantization/test_quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,9 @@ def forward(self, x):
def test_leaky_relu(self):
self._test_activation_op_impl(nn.LeakyReLU, nnq.LeakyReLU, {'negative_slope': 0.1, 'inplace': False})

def test_sigmoid(self):
self._test_activation_op_impl(nn.Sigmoid, nnq.Sigmoid, {})

class TestFunctionalModule(QuantizationTestCase):
# Histogram Observers are slow, so have no-deadline to ensure test doesn't time out
@given(train_mode=st.booleans())
Expand Down
1 change: 1 addition & 0 deletions torch/quantization/quantization_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
nn.Hardswish: nnq.Hardswish,
nn.ELU: nnq.ELU,
nn.LeakyReLU: nnq.LeakyReLU,
nn.Sigmoid: nnq.Sigmoid,
nn.Conv1d: nnq.Conv1d,
nn.Conv2d: nnq.Conv2d,
nn.Conv3d: nnq.Conv3d,
Expand Down