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

Error message if non integer value used with BFV scheme #4042

Merged
merged 2 commits into from
Aug 26, 2020

Conversation

rav1kantsingh
Copy link
Member

Description

Just added an error message for the case when the bfv scheme is used with non-interger values.

Affected Dependencies

None

Checklist

@rav1kantsingh rav1kantsingh added the Priority: 3 - Medium 😒 Should be fixed soon, but there may be other pressing matters that come first label Aug 19, 2020
@rav1kantsingh rav1kantsingh added this to the BFV Tensor in Python milestone Aug 19, 2020
@rav1kantsingh rav1kantsingh requested a review from a team as a code owner August 19, 2020 11:10
@@ -41,7 +41,8 @@ def encode(self, value):
Returns:
A PlainText object containing the integer value.
"""

if not isinstance(value, int):
raise ValueError(f"BFV scheme only works with integer values, whereas provided {value}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe show the type of the value instead of the value itself?

@codecov
Copy link

codecov bot commented Aug 20, 2020

Codecov Report

Merging #4042 into master will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4042      +/-   ##
==========================================
- Coverage   94.78%   94.77%   -0.01%     
==========================================
  Files         205      205              
  Lines       21182    21184       +2     
==========================================
  Hits        20077    20077              
- Misses       1105     1107       +2     
Impacted Files Coverage Δ
syft/frameworks/torch/he/fv/integer_encoder.py 89.47% <50.00%> (-1.44%) ⬇️
...ft/frameworks/torch/tensors/interpreters/native.py 91.27% <0.00%> (-0.22%) ⬇️

@youben11 youben11 merged commit fc4bfcd into OpenMined:master Aug 26, 2020
rav1kantsingh added a commit to rav1kantsingh/PySyft that referenced this pull request Oct 29, 2020
* Error message if non integer values given to BFV scheme

* error message update; show type instead of value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3 - Medium 😒 Should be fixed soon, but there may be other pressing matters that come first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants