File size: 851 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
# Copyright(C) [2025] Advanced Micro Devices, Inc. All rights reserved.
class BaseProcessor:
    """
    Base class for all processors.
    This class should be inherited by all processors.
    """

    def __init__(self, name: str):
        self.name = name

    def __call__(self, *args, **kwargs):
        """
        Call the process method with the given data.
        This method can be overridden by subclasses if needed.
        """
        return self.process(*args, **kwargs)

    def process(self, *args, **kwargs):
        return NotImplementedError("Subclasses must implement the __call__ method.")

    def __str__(self):
        """
        Return a string representation of the processor.
        This method can be overridden by subclasses if needed.
        """
        return f"{self.__class__.__name__} with config: {self.config}"