def _do_push_pull_async(tensor, output, average, name, version=0, priority=0): c_lib.byteps_torch_declare_tensor( name.encode() if name is not None else _NULL) function = _check_function(_push_pull_function_factory, tensor) handle = getattr(c_lib, function)(tensor, output, average, name.encode() if name is not None else _NULL, version, priority) _handle_map[handle] = (tensor, output) return handle
def declare(name): c_lib.byteps_torch_declare_tensor(name.encode()) return 0