|
MLIR 22.0.0git
|
Wrapper around the generic MlirAttribute. More...
#include "mlir/Bindings/Python/IRCore.h"
Public Member Functions | |
| PyAttribute (PyMlirContextRef contextRef, MlirAttribute attr) | |
| bool | operator== (const PyAttribute &other) const |
| operator MlirAttribute () const | |
| MlirAttribute | get () const |
| nanobind::object | getCapsule () |
| Gets a capsule wrapping the void* within the MlirAttribute. | |
| nanobind::typed< nanobind::object, PyAttribute > | maybeDownCast () |
| Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::BaseContextObject | |
| BaseContextObject (PyMlirContextRef ref) | |
| PyMlirContextRef & | getContext () |
| Accesses the context reference. | |
Static Public Member Functions | |
| static PyAttribute | createFromCapsule (const nanobind::object &capsule) |
| Creates a PyAttribute from the MlirAttribute wrapped by a capsule. | |
Wrapper around the generic MlirAttribute.
The lifetime of a type is bound by the PyContext that created it.
|
inline |
Definition at line 1010 of file IRCore.h.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::BaseContextObject::BaseContextObject().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedTy, BaseTy >::bind(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::gpu::ObjectAttr::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyArrayAttribute::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDictAttribute::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::sparse_tensor::EncodingAttr::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedTy, BaseTy >::castFrom(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyArrayAttribute::PyArrayAttributeIterator::dunderNext(), getCapsule(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedTy, BaseTy >::PyConcreteAttribute().
|
static |
Creates a PyAttribute from the MlirAttribute wrapped by a capsule.
Note that PyAttribute instances are uniqued, so the returned object may be a pre-existing object. Ownership of the underlying MlirAttribute is taken by calling this function.
Definition at line 1907 of file IRCore.cpp.
References mlirPythonAttributeToCapsule().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
inline |
Definition at line 1014 of file IRCore.h.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeAttribute::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyArrayAttribute::PyArrayAttributeIterator::dunderNext().
| nb::object mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyAttribute::getCapsule | ( | ) |
Gets a capsule wrapping the void* within the MlirAttribute.
Definition at line 1903 of file IRCore.cpp.
References mlirAttributeEqual(), and PyAttribute().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
| nb::typed< nb::object, PyAttribute > mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyAttribute::maybeDownCast | ( | ) |
Definition at line 1915 of file IRCore.cpp.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::forContext().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMemRefType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRankedTensorType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyUnrankedMemRefType::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
inline |
| bool mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyAttribute::operator== | ( | const PyAttribute & | other | ) | const |
Definition at line 1899 of file IRCore.cpp.