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)
def test_communication_methods_accepted(): c = CommunicationAction("send", None, (), {}, ()) assert c.name == "send"
def test_computation_methods_rejected(): with pytest.raises(ValueError): CommunicationAction("__add__", None, (), {}, ())
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)