MLIR 22.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue Class Reference

Wrapper around the generic MlirValue. More...

#include "mlir/Bindings/Python/IRCore.h"

Inheritance diagram for mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue:

Public Member Functions

virtual ~PyValue ()=default
 PyValue (PyOperationRef parentOperation, MlirValue value)
 operator MlirValue () const
MlirValue get ()
PyOperationRefgetParentOperation ()
void checkValid ()
nanobind::object getCapsule ()
 Gets a capsule wrapping the void* within the MlirValue.
nanobind::typed< nanobind::object, PyValuemaybeDownCast ()

Static Public Member Functions

static PyValue createFromCapsule (nanobind::object capsule)
 Creates a PyValue from the MlirValue wrapped by a capsule.

Detailed Description

Wrapper around the generic MlirValue.

Values are managed completely by the operation that resulted in their definition. For op result value, this is the operation that defines the value. For block argument values, this is the operation that contains the block to which the value is an argument (blocks cannot be detached in Python bindings so such operation always exists).

Definition at line 1173 of file IRCore.h.

Constructor & Destructor Documentation

◆ ~PyValue()

virtual mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::~PyValue ( )
virtualdefault

◆ PyValue()

Member Function Documentation

◆ checkValid()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::checkValid ( )
inline

Definition at line 1186 of file IRCore.h.

◆ createFromCapsule()

PyValue mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::createFromCapsule ( nanobind::object capsule)
static

Creates a PyValue from the MlirValue wrapped by a capsule.

Ownership of the underlying MlirValue is still tied to the owning operation.

Definition at line 2016 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ get()

◆ getCapsule()

nb::object mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::getCapsule ( )

Gets a capsule wrapping the void* within the MlirValue.

Definition at line 1997 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ getParentOperation()

PyOperationRef & mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::getParentOperation ( )
inline

◆ maybeDownCast()

nb::typed< nb::object, PyValue > mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::maybeDownCast ( )

◆ operator MlirValue()

mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::operator MlirValue ( ) const
inline

Definition at line 1181 of file IRCore.h.


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