Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crypten/mpc/primitives/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ def _arithmetic_function(self, y, op, inplace=False, *args, **kwargs):
else: # ['mul', 'matmul', 'convNd', 'conv_transposeNd']
# NOTE: 'mul_' calls 'mul' here
# Must copy share.data here to support 'mul_' being inplace
result.share.data = getattr(beaver, op)(
result, y, *args, **kwargs
).share.data
result.share.set_(getattr(beaver, op)(
Copy link

Choose a reason for hiding this comment

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

I think the comment above is stale now.

Is the .data below still needed? I think in pytorch we intend to eventually deprecate .data.

result, y, *args, **kwargs).share.data
)
else:
raise TypeError("Cannot %s %s with %s" % (op, type(y), type(self)))

Expand Down
2 changes: 1 addition & 1 deletion crypten/mpc/primitives/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __iand__(self, y):
if torch.is_tensor(y) or isinstance(y, int):
self.share &= y
elif isinstance(y, BinarySharedTensor):
self.share.data = beaver.AND(self, y).share.data
self.share.set_(beaver.AND(self, y).share.data)
else:
raise TypeError("Cannot AND %s with %s." % (type(y), type(self)))
return self
Expand Down