File size: 1,027 Bytes
02c783d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# Copyright(C) [2025] Advanced Micro Devices, Inc. All rights reserved.
class BasePerfEval:
"""
Base class for performance evaluation.
"""
def __init__(self, name="BasePerfEval"):
"""
Initialize the BasePerfEval class.
Args:
name (str): Name of the evaluation instance.
"""
self.name = name
def __call__(self, *args, **kwargs):
"""
Call the evaluate method to perform evaluation.
"""
return self.evaluate(*args, **kwargs)
def evaluate(self):
"""
Evaluate the model on the dataset.
"""
raise NotImplementedError("Subclasses should implement this method.")
def report(self):
"""
Report the evaluation results.
"""
raise NotImplementedError("Subclasses should implement this method.")
def __str__(self):
"""
String representation of the evaluation instance.
"""
return f"{self.__class__.__name__}({self.name})"
|