How to use the visualdl.python.summary._Scalar function in visualdl

To help you get started, we’ve selected a few visualdl 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 PaddlePaddle / VisualDL / visualdl / python / summary.py View on Github external
name of this component.
    :param dtype: string
        the data type that will be used in underlying storage.
    :return: object of core.Tablet
    '''
    assert dtype in dtypes, "invalid dtype(%s), should be one of %s" % (
        dtype, str(dtypes))
    tablet = core.im().add_tablet(tag, -1)
    dtype2obj = {
        'float': tablet.as_float_scalar,
        'double': tablet.as_double_scalar,
        'int32': tablet.as_int32_scalar,
        'int64': tablet.as_int64_scalar,
    }
    obj = dtype2obj[dtype]()
    return _Scalar(obj)
github PaddlePaddle / VisualDL / visualdl / python / summary.py View on Github external
def read_scalar(tag, dtype='float'):
    tablet = core.im().tablet(tag)
    dtype2obj = {
        'float': tablet.as_float_scalar,
        'double': tablet.as_double_scalar,
        'int32': tablet.as_int32_scalar,
        'int64': tablet.as_int64_scalar,
    }
    obj = dtype2obj[dtype]()
    return _Scalar(obj)