MLIR  19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::python::PyOpView Class Reference

A PyOpView is equivalent to the C++ "Op" wrappers: these are the basis for providing more instance-specific accessors and serve as the base class for custom ODS-style operation classes. More...

#include "Bindings/Python/IRModule.h"

+ Inheritance diagram for mlir::python::PyOpView:

Public Member Functions

 PyOpView (const pybind11::object &operationObject)
 
PyOperationgetOperation () override
 Each must provide access to the raw Operation. More...
 
pybind11::object getOperationObject ()
 
- Public Member Functions inherited from mlir::python::PyOperationBase
virtual ~PyOperationBase ()=default
 
void print (std::optional< int64_t > largeElementsLimit, bool enableDebugInfo, bool prettyDebugInfo, bool printGenericOpForm, bool useLocalScope, bool assumeVerified, py::object fileObject, bool binary)
 Implements the bound 'print' method and helps with others. More...
 
void print (PyAsmState &state, py::object fileObject, bool binary)
 
pybind11::object getAsm (bool binary, std::optional< int64_t > largeElementsLimit, bool enableDebugInfo, bool prettyDebugInfo, bool printGenericOpForm, bool useLocalScope, bool assumeVerified)
 
void writeBytecode (const pybind11::object &fileObject, std::optional< int64_t > bytecodeVersion)
 
void moveAfter (PyOperationBase &other)
 Moves the operation before or after the other operation. More...
 
void moveBefore (PyOperationBase &other)
 
bool verify ()
 Verify the operation. More...
 

Static Public Member Functions

static pybind11::object buildGeneric (const pybind11::object &cls, std::optional< pybind11::list > resultTypeList, pybind11::list operandList, std::optional< pybind11::dict > attributes, std::optional< std::vector< PyBlock * >> successors, std::optional< int > regions, DefaultingPyLocation location, const pybind11::object &maybeIp)
 
static pybind11::object constructDerived (const pybind11::object &cls, const PyOperation &operation)
 Construct an instance of a class deriving from OpView, bypassing its __init__ method. More...
 

Detailed Description

A PyOpView is equivalent to the C++ "Op" wrappers: these are the basis for providing more instance-specific accessors and serve as the base class for custom ODS-style operation classes.

Since this class is subclass on the python side, it must present an init method that operates in pure python types.

Definition at line 721 of file IRModule.h.

Constructor & Destructor Documentation

◆ PyOpView()

PyOpView::PyOpView ( const pybind11::object &  operationObject)

Definition at line 1788 of file IRCore.cpp.

Member Function Documentation

◆ buildGeneric()

py::object PyOpView::buildGeneric ( const pybind11::object &  cls,
std::optional< pybind11::list >  resultTypeList,
pybind11::list  operandList,
std::optional< pybind11::dict >  attributes,
std::optional< std::vector< PyBlock * >>  successors,
std::optional< int >  regions,
DefaultingPyLocation  location,
const pybind11::object &  maybeIp 
)
static

◆ constructDerived()

pybind11::object PyOpView::constructDerived ( const pybind11::object &  cls,
const PyOperation operation 
)
static

Construct an instance of a class deriving from OpView, bypassing its __init__ method.

The derived class will typically define a constructor that provides a convenient builder, but we need to side-step this when constructing an OpView for an already-built operation.

The caller is responsible for verifying that operation is a valid operation to construct cls with.

Definition at line 1777 of file IRCore.cpp.

Referenced by mlir::python::PyOperation::createOpView().

◆ getOperation()

PyOperation& mlir::python::PyOpView::getOperation ( )
inlineoverridevirtual

Each must provide access to the raw Operation.

Implements mlir::python::PyOperationBase.

Definition at line 724 of file IRModule.h.

◆ getOperationObject()

pybind11::object mlir::python::PyOpView::getOperationObject ( )
inline

Definition at line 726 of file IRModule.h.


The documentation for this class was generated from the following files: