INNER CODE UNIT · Python

CallableList

horovod/horovod · horovod/_keras/__init__.py:258

class CallableList(list):
    """Temporary shim to support both `opt.variables()` and `opt.variables`."""

    def __call__(self):
        return self


def _eval(backend, op_or_result):
    if hvd._executing_eagerly():
        return op_or_result
    else:
        return backend.get_session().run(op_or_result)


if hasattr(hvd, 'broadcast_global_variables'):
    def broadcast_global_variables(backend, root_rank):
        return _eval(backend, hvd.broadcast_global_variables(root_rank))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…