MLCompilerBridge
Tools for streamlining communication with ML models for compiler optimizations.
Loading...
Searching...
No Matches
BaseCompilerInterface.py
Go to the documentation of this file.
1# ------------------------------------------------------------------------------
2#
3# Part of the MLCompilerBridge Project, under the Apache License v2.0 with LLVM
4# Exceptions. See the LICENSE file for license information.
5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6#
7# ------------------------------------------------------------------------------
8
15
16
17from abc import ABC, abstractmethod
18from .SerDes import SerDes
19
20
22
23 def __init__(self, data_format=None):
24 self.serdes_obj = SerDes(data_format)
25
26
28 def populate_buffer(self, data):
29 self.serdes_obj.serializeData(data)
30
31 @abstractmethod
32
33 def evaluate(self):
34 pass
This base class specifies methods for communication with compiler.
populate_buffer(self, data)
Places data for next request into a buffer after serialization.
__init__(self, data_format=None)
Initializes correct SerDes object.
evaluate(self)
Sends query to compiler and returns deserialized result.
Class for serialization and deserialization in various formats for communication.
Definition SerDes.py:30