예제 #1
0
 def communication(obj_id, name, source, destinations, kwargs_):
     """ Helper function to build a TensorCommandMessage containing a CommunicationAction
     directly from the action arguments.
     """
     action = CommunicationAction(obj_id, name, source, destinations,
                                  kwargs_)
     return TensorCommandMessage(action)
예제 #2
0
def test_communication_methods_accepted():
    c = CommunicationAction("send", None, (), {}, ())

    assert c.name == "send"
예제 #3
0
def test_computation_methods_rejected():
    with pytest.raises(ValueError):
        CommunicationAction("__add__", None, (), {}, ())
예제 #4
0
파일: message.py 프로젝트: kylinLiu/PySyft
 def communication(name, target, args_, kwargs_, return_ids):
     """ Helper function to build a TensorCommandMessage containing a CommunicationAction
     directly from the action arguments.
     """
     action = CommunicationAction(name, target, args_, kwargs_, return_ids)
     return TensorCommandMessage(action)