Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenMined/SyMPC
/ functions
Functions
591 in github.com/OpenMined/SyMPC
⨍
Functions
591
◇
Types & classes
44
↳
Endpoints
9
Function
cat_share_tensor
Helper method that performs torch.cat on the shares of the Tensors. Args: session_uuid_str (str): UUID to identify the session on each pa
src/sympc/tensor/static.py:110
Method
compute_zvalue_and_add_mask
Operation to compute local z share and add mask to it. Args: x (ReplicatedSharedTensor): Secret. y (ReplicatedSharedT
src/sympc/protocol/falcon/falcon.py:349
Function
conv2d_store_add
Add the primitives required for the "conv2d" operation to the CryptoStore. Args: store (Any): The CryptoStore. primitives (Iterab
src/sympc/protocol/beaver/beaver.py:356
Function
conv2d_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "conv2d" operation. Args: store: the CryptoStore
src/sympc/protocol/beaver/beaver.py:378
Function
conv_transpose2d_store_add
Add the primitives required for the "conv_transpose2d" operation to the CryptoStore. Args: store (Any): The CryptoStore. primitiv
src/sympc/protocol/beaver/beaver.py:439
Function
conv_transpose2d_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "conv_transpose2d" operation. Args: store: the Cryp
src/sympc/protocol/beaver/beaver.py:461
Function
count_wraps_rand
Count wraps random. The Trusted Third Party (TTP) or Crypto provider should generate: - a set of shares for a random number - a set of s
src/sympc/protocol/beaver/beaver.py:505
Function
decompose
Decompose a tenstor into its binary representation. Args: tensor (torch.Tensor): Tensor to decompose. ring_size (int): Ring size.
src/sympc/utils/mpc_utils.py:126
Method
distribute_shares
Distribute a list of shares. Args: shares (List[ShareTensor): list of shares to distribute. session (Session): Sessio
src/sympc/tensor/replicatedshare_tensor.py:922
Method
div
Apply the "div" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ShareTensor"]): Denominator.
src/sympc/tensor/share_tensor.py:319
Function
div_wraps
From CrypTen Privately computes the number of wraparounds for a set a shares. To do so, we note that: [theta_x] = theta_z + [beta_xr] - [
src/sympc/protocol/spdz/spdz.py:234
Method
eq
Equal operator. Check if "self" is equal with another object given a set of attributes to compare. Args: y (Any): Object
src/sympc/tensor/replicatedshare_tensor.py:669
Method
eq
Equal operator. Args: x1 (MPCTensor): First private value. x2 (MPCTensor): Second private value. Returns:
src/sympc/protocol/fss/fss.py:205
Function
evaluate
Evaluate the FSS protocol on the masked and public input `x_masked`. Args: session (Session): MPC Session b: rank of the evaluato
src/sympc/protocol/fss/fss.py:79
Method
falcon_mask
Falcon mask. Args: x_sh (ReplicatedSharedTensor): X share y_sh (ReplicatedSharedTensor) : Y share op_str
src/sympc/protocol/falcon/falcon.py:246
Method
forward
Perform the feedforward and compute the result for the implemented operation. Args: ctx (Dict[str, Any]): Context used to save in
src/sympc/grads/grad_functions.py:59
Method
forward
Perform the feedforward and compute the result for the addition operation. Args: ctx (Dict[str, Any]): Context used to save infor
src/sympc/grads/grad_functions.py:127
Method
forward
Perform the feedforward and compute the result for the summation operation. Args: ctx (Dict[str, Any]): Context used to save info
src/sympc/grads/grad_functions.py:169
Method
forward
Perform the feedforward and compute the result for the sigmoid operation. Args: ctx (Dict[str, Any]): Context used to save inform
src/sympc/grads/grad_functions.py:207
Method
forward
Perform the feedforward and compute the result for the substraction operation. Args: ctx (Dict[str, Any]): Context used to save i
src/sympc/grads/grad_functions.py:241
Method
forward
Perform the feedforward and compute the result for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to save
src/sympc/grads/grad_functions.py:282
Method
forward
Perform the feedforward and compute the result for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to save
src/sympc/grads/grad_functions.py:322
Method
forward
Perform the feedforward and compute the result for the division operation. Args: ctx (Dict[str, Any]): Context used to save infor
src/sympc/grads/grad_functions.py:365
Method
forward
Perform the feedforward and compute the result for the matrix multiplication operation. Args: ctx (Dict[str, Any]): Context used
src/sympc/grads/grad_functions.py:407
Method
forward
Perform the feedforward and compute the result for the multiplication operation. Args: ctx (Dict[str, Any]): Context used to save
src/sympc/grads/grad_functions.py:464
Method
forward
Perform the feedforward and compute the result for the conv2d operation. Args: ctx (Dict[str, Any]): Context used to save informa
src/sympc/grads/grad_functions.py:500
Method
forward
Perform the feedforward and compute the result for the reshape operation. Args: ctx (Dict[str, Any]): Context used to save inform
src/sympc/grads/grad_functions.py:614
Method
forward
Perform the feedforward and compute the result for the ReLU operation. Args: ctx (Dict[str, Any]): Context used to save informati
src/sympc/grads/grad_functions.py:649
Method
forward
Perform the feedforward and compute the result for the MaxPool2D operation. Args: ctx (Dict[str, Any]): Context used to save info
src/sympc/grads/grad_functions.py:683
Method
forward
Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor that results by app
src/sympc/module/nn/linear.py:47
Method
forward
Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor representing the la
src/sympc/module/nn/conv.py:64
Method
forward
(self, x)
tests/sympc/module/module_test.py:25
Method
forward
(self, x)
tests/sympc/module/module_test.py:46
Method
forward
(self, x)
tests/sympc/module/module_test.py:161
Method
forward
(self, x)
tests/sympc/store/crypto_primitive_provider_test.py:31
Method
forward
Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor representing the la
benchmarks/module/conv_model.py:34
Method
ge
Greater or equal operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the
src/sympc/tensor/mpc_tensor.py:1082
Function
generate_primitive
(n_values: int)
src/sympc/protocol/fss/fss.py:348
Method
get_shares
Get shares. Returns: List[torch.Tensor]: List of shares.
src/sympc/tensor/replicatedshare_tensor.py:141
Method
get_torch_module
Get a torch module from a given MPC Layer module. The parameters of the models are not set. Args: linear_module (Linear)
src/sympc/module/nn/linear.py:130
Function
get_triples_conv2d
Get the beaver triples for the conv2d operation. Args: *args: Arguments for _get_triples. **kwargs: Keyword arguments for _get_tr
src/sympc/protocol/beaver/beaver.py:339
Function
get_triples_matmul
Get the beaver triples for the matmul operation. Args: *args (List[ShareTensor]): Named arguments of :func:`beaver.__get_triples`.
src/sympc/protocol/beaver/beaver.py:255
Function
get_triples_mul
Get the beaver triples for the multiplication operation. Args: *args (List[ShareTensor]): Named arguments of :func:`beaver.__get_triples`
src/sympc/protocol/beaver/beaver.py:172
Function
get_triples_transpose2d
Get the beaver triples for the conv_transpose2d operation. Args: *args: Arguments for _get_triples. **kwargs: Keyword arguments f
src/sympc/protocol/beaver/beaver.py:422
Method
gt
Greater than operator. Args: y: self>y Raises: NotImplementedError: Raised when implementation not present
src/sympc/tensor/replicatedshare_tensor.py:658
Function
helper_argmax_pairwise
Helper function that would compute the difference between all the elements in a tensor. Credits goes to the CrypTen team. Args: sess
src/sympc/tensor/static.py:289
Function
helper_max_pool2d_reshape
Function that runs at each party for preparing the share. Reshape each share tensor to prepare it for calling 'argmax'. The new share would h
src/sympc/module/nn/functional.py:173
Method
hook_method
Hook a framework method such that we know how to treat it given that we call it. Ex: * if we call "numel" we want to call it on the
src/sympc/tensor/replicatedshare_tensor.py:1007
Method
hook_method
Hook a framework method such that we know how to treat it given that we call it. Ex: * if we call "numel" we want to call it on the
src/sympc/tensor/share_tensor.py:452
Method
hook_method
Hook a framework method. Ex: * if we call "numel" we want to forward it only to one share and return the result (without wra
src/sympc/tensor/mpc_tensor.py:1022
Method
hook_property
Hook a framework property (only getter). Ex: * if we call "shape" we want to call it on the underlying tensor and return the
src/sympc/tensor/replicatedshare_tensor.py:964
Method
hook_property
Hook a framework property (only getter). Ex: * if we call "shape" we want to call it on the underlying tensor and return the
src/sympc/tensor/share_tensor.py:418
Method
hook_property
Hook a framework property (only getter). Ex: * if we call "shape" we want to call it on the underlying share and return the
src/sympc/tensor/mpc_tensor.py:983
Function
initializer
Set the same event loop to other threads/processes. This is needed because there are new threads/processes started with the Executor
src/sympc/utils/utils.py:66
Method
le
Lower equal operator. Args: x1 (MPCTensor): First private value. x2 (MPCTensor): Second private value. Retur
src/sympc/protocol/fss/fss.py:218
Method
lt
Lower than operator. Args: y: self<y Raises: NotImplementedError: Raised when implementation not present
src/sympc/tensor/replicatedshare_tensor.py:647
Method
lt
Lower than operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the compar
src/sympc/tensor/mpc_tensor.py:1095
Function
mask_builder
Mask the private inputs. Add the share of alpha (the mask) that is held in the crypto store to the difference x1 - x2. As we aim at compa
src/sympc/protocol/fss/fss.py:45
Method
matmul
Apply the "matmul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ReplicatedSharedTensor"]): self@y
src/sympc/tensor/replicatedshare_tensor.py:494
Function
matmul_store_add
Add the primitives required for the "matmul" operation to the CryptoStore. Args: store (Any): The CryptoStore. primitives (Iterab
src/sympc/protocol/beaver/beaver.py:272
Function
matmul_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "matmul" operation. Args: store (Dict[Tuple[int, in
src/sympc/protocol/beaver/beaver.py:295
Function
max_mpc
Compute the maximum value for an MPCTensor. Args: x (MPCTensor): MPCTensor to be computed the maximum value on. dim (Optional[Uni
src/sympc/tensor/static.py:252
Function
max_pool2d
Compute the max pool for a tensor with 2 dimension. Args: x (MPCTensor): the MPCTensor on which to apply the operation kernel_siz
src/sympc/module/nn/functional.py:237
Function
max_pool2d_backward
Helper function for the backwards step for max_pool2d. Credits goes to the CrypTen team. Args: grad (MPCTensor): gradient that comes
src/sympc/module/nn/functional.py:384
Function
max_pool2d_backward_helper
Helper function to compute the gradient needed to be passed to the parent node. Args: input_shape (Tuple[int]): the size of the input ten
src/sympc/module/nn/functional.py:313
Method
method
( _self: "ReplicatedSharedTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/replicatedshare_tensor.py:1040
Method
method
( _self: "ShareTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/share_tensor.py:477
Method
method_all_shares
( _self: "MPCTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/mpc_tensor.py:1038
Method
method_new_rs_tensor
( _self: "ReplicatedSharedTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/replicatedshare_tensor.py:1024
Method
method_new_share_tensor
( _self: "ShareTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/share_tensor.py:468
Method
method_share
( _self: "MPCTensor", *args: List[Any], **kwargs: Dict[Any, Any] )
src/sympc/tensor/mpc_tensor.py:1055
Method
mul
Apply the "mul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ReplicatedSharedTensor"]): self*y
src/sympc/tensor/replicatedshare_tensor.py:455
Method
mul
Apply the "mul" operation between "self" and "y". Args: y (Union[int, float, torch.Tensor, "ShareTensor"]): self * y Ret
src/sympc/tensor/share_tensor.py:253
Function
mul_master
Function that is executed by the orchestrator to multiply two secret values. Args: x (MPCTensor): First value to multiply with. y
src/sympc/protocol/spdz/spdz.py:36
Function
mul_parties
SPDZ Multiplication. Args: session_uuid_str (str): UUID to identify the session on each party side. eps (torch:tensor): Epsilon v
src/sympc/protocol/spdz/spdz.py:125
Function
mul_store_add
Add the primitives required for the "mul" operation to the CryptoStore. Arguments: store (Dict[Any, Any]): the CryptoStore primit
src/sympc/protocol/beaver/beaver.py:189
Function
mul_store_get
Retrieve the primitives from the CryptoStore. Those are needed for executing the "mul" operation. Args: store (Dict[Tuple[int, int],
src/sympc/protocol/beaver/beaver.py:211
Method
mulmodprime
Computes multiplication(x*y) modulo PRIME_NUMBER constant. Args: x (torch.Tensor): input tensor y (torch.tensor): inp
src/sympc/tensor/replicatedshare_tensor.py:216
Method
ne
Not Equal operator. Args: y: self!=y Raises: NotImplementedError: Raised when implementation not present
src/sympc/tensor/replicatedshare_tensor.py:715
Method
ne
Not equal operator. Args: other (MPCTensor): MPCTensor to compare. Returns: MPCTensor: Result of the compari
src/sympc/tensor/mpc_tensor.py:1145
Method
parameters
Get the parameters of the Linear module. Args: recurse (bool): For the moment not used. TODO Yields: Each pa
src/sympc/module/nn/linear.py:65
Method
parameters
Get the parameters of the Linear module. Args: recurse (bool): For the moment not used. TODO Yields: Each pa
src/sympc/module/nn/conv.py:154
Method
precision
Get the precision for the FixedPrecision Encoder. Returns: int: precision.
src/sympc/encoder/fp_encoder.py:95
Method
property_all_share_getter
(_self: "MPCTensor")
src/sympc/tensor/mpc_tensor.py:999
Method
property_getter
(_self: "ReplicatedSharedTensor")
src/sympc/tensor/replicatedshare_tensor.py:995
Method
property_getter
(_self: "ShareTensor")
src/sympc/tensor/share_tensor.py:440
Method
property_new_rs_tensor_getter
(_self: "ReplicatedSharedTensor")
src/sympc/tensor/replicatedshare_tensor.py:980
Method
property_new_share_tensor_getter
(_self: "ShareTensor")
src/sympc/tensor/share_tensor.py:434
Method
property_share_getter
(_self: "MPCTensor")
src/sympc/tensor/mpc_tensor.py:1010
Function
provider_test
This function will generate the values: [((0, 0, 0, 0), (0, 0, 0, 0), ...), ((1, 1, 1, 1), (1, 1, 1, 1)), ...]
tests/sympc/store/crypto_primitive_provider_test.py:38
Function
provider_test_add
( store: Dict[str, List[Any]], primitives: Iterable[Any] )
tests/sympc/store/crypto_primitive_provider_test.py:63
Function
provider_test_add
( store: Dict[str, List[Any]], primitives: Iterable[Any] )
tests/sympc/store/crypto_store_test.py:32
Function
provider_test_get
( store: Dict[str, List[Any]], nr_instances: int )
tests/sympc/store/crypto_primitive_provider_test.py:55
Function
provider_test_get
( store: Dict[str, List[Any]], nr_instances: int )
tests/sympc/store/crypto_store_test.py:24
Function
public_divide
Function that is executed by the orchestrator to divide a secret by a public value. Args: x (MPCTensor): Private numerator. y (Un
src/sympc/protocol/spdz/spdz.py:181
Function
reconstruct
Get back the shares from all the parties and reconstruct the underlying value. Returns: Neural network module with the secret reconstruct
src/sympc/module/__init__.py:86
Method
reconstruct
Reconstruct value from shares. Args: share_ptrs (List[ReplicatedSharedTensor]): List of RSTensor pointers. security_t
src/sympc/tensor/replicatedshare_tensor.py:841
Method
reconstruct
Reconstruct original value from shares. Args: share_ptrs (List[ShareTensor]): List of sharetensors. get_shares (boole
src/sympc/tensor/share_tensor.py:492
Method
reconstruct_state_dict
Reconstruct the shared state dict. Returns: The reconstructed state dict (Dict[str, Any])
src/sympc/module/nn/linear.py:115
Function
register_add
(func_add)
src/sympc/store/__init__.py:34
← previous
next →
201–300 of 591, ranked by callers