コード例 #1
0
ファイル: mpc_tensor.py プロジェクト: quantummixer/SyMPC
        def _request_and_get(share_ptr: ShareTensor) -> ShareTensor:
            """Function used to request and get a share - Duet Setup
            :return: the ShareTensor (local)
            :rtype: ShareTensor
            """

            if not islocal(share_ptr):
                share_ptr.request(name="reconstruct", block=True)
            res = share_ptr.get_copy()
            return res
コード例 #2
0
ファイル: mpc_tensor.py プロジェクト: radhikasethi2011/SyMPC
        def _request_and_get(share_ptr: ShareTensor) -> ShareTensor:
            """Function used to request and get a share - Duet Setup.

            Args:
                share_ptr (ShareTensor): a ShareTensor

            Returns:
                ShareTensor. The ShareTensor in local.

            """
            if not islocal(share_ptr):
                share_ptr.request(block=True)
            res = share_ptr.get_copy()
            return res
コード例 #3
0
    def _request_and_get(
        share_ptr: "ReplicatedSharedTensor", ) -> "ReplicatedSharedTensor":
        """Function used to request and get a share - Duet Setup.

        Args:
            share_ptr (ReplicatedSharedTensor): input ReplicatedSharedTensor

        Returns:
            ReplicatedSharedTensor : The ReplicatedSharedTensor in local.
        """
        if not ispointer(share_ptr):
            return share_ptr
        elif not islocal(share_ptr):
            share_ptr.request(block=True)
        res = share_ptr.get_copy()
        return res