Shortcuts

Source code for ts.metrics.dimension



"""
Dimension class for model server metrics
"""


[docs]class Dimension(object): """ Dimension class defining key value pair """ def __init__(self, name, value): """ Constructor for Dimension class Parameters ---------- name: str NAme of dimension value : str Unique Value of dimension """ self.name = name self.value = value def __str__(self): """ Return a string value :return: """ return "{}:{}".format(self.name, self.value)
[docs] def to_dict(self): """ return an dictionary """ return {'Name': self.name, 'Value': self.value}

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources