How to use the byteps.torch.c_lib.byteps_torch_declare_tensor function in byteps

To help you get started, we’ve selected a few byteps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bytedance / byteps / byteps / torch / ops.py View on Github external
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
github bytedance / byteps / byteps / torch / ops.py View on Github external
def declare(name):
    c_lib.byteps_torch_declare_tensor(name.encode())
    return 0