MLIR 23.0.0git
nanobind::detail::type_caster< MlirAttribute > Struct Reference

Casts object <-> MlirAttribute. More...

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

Public Member Functions

 NB_TYPE_CASTER (MlirAttribute, const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Attribute"))) bool from_python(handle src

Static Public Member Functions

static handle from_cpp (MlirAttribute v, rv_policy, cleanup_list *cleanup) noexcept

Public Attributes

uint8_t flags
uint8_t cleanup_list *cleanup noexcept

Detailed Description

Casts object <-> MlirAttribute.

Definition at line 141 of file NanobindAdaptors.h.

Member Function Documentation

◆ from_cpp()

handle nanobind::detail::type_caster< MlirAttribute >::from_cpp ( MlirAttribute v,
rv_policy ,
cleanup_list * cleanup )
inlinestaticnoexcept

◆ NB_TYPE_CASTER()

nanobind::detail::type_caster< MlirAttribute >::NB_TYPE_CASTER ( MlirAttribute ,
const_name(MAKE_MLIR_PYTHON_QUALNAME("ir.Attribute"))  )

Member Data Documentation

◆ flags

uint8_t nanobind::detail::type_caster< MlirAttribute >::flags

Definition at line 144 of file NanobindAdaptors.h.

◆ noexcept

uint8_t cleanup_list* cleanup nanobind::detail::type_caster< MlirAttribute >::noexcept
Initial value:
{
if (auto capsule = mlirApiObjectToCapsule(src)) {
value = mlirPythonCapsuleToAttribute(capsule->ptr());
return !mlirAttributeIsNull(value);
}
return false
static MlirAttribute mlirPythonCapsuleToAttribute(PyObject *capsule)
Extracts an MlirAttribute from a capsule as produced from mlirPythonAttributeToCapsule.
Definition Interop.h:189
static std::optional< nanobind::object > mlirApiObjectToCapsule(nanobind::handle apiObject)
Helper to convert a presumed MLIR API object to a capsule, accepting either an explicit Capsule (whic...

Definition at line 144 of file NanobindAdaptors.h.


The documentation for this struct was generated from the following file: