MLIR 22.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseArrayAttribute< EltTy, DerivedT > Class Template Reference

A python-wrapped dense array attribute with an element type and a derived implementation class. More...

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

Inheritance diagram for mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseArrayAttribute< EltTy, DerivedT >:

Classes

class  PyDenseArrayIterator
 Iterator over the integer elements of a dense array. More...

Public Member Functions

EltTy getItem (intptr_t i)
 Get the element at the given index.
Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedT >
 PyConcreteAttribute ()=default
Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyAttribute
 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, PyAttributemaybeDownCast ()
Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::BaseContextObject
 BaseContextObject (PyMlirContextRef ref)
PyMlirContextRefgetContext ()
 Accesses the context reference.

Static Public Member Functions

static void bindDerived (typename PyConcreteAttribute< DerivedT >::ClassTy &c)
 Bind the attribute class.
Static Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedT >
static MlirAttribute castFrom (PyAttribute &orig)
static void bind (nanobind::module_ &m, PyType_Slot *slots=nullptr)
static void bindDerived (ClassTy &m)
 Implemented by derived classes to add methods to the Python subclass.
Static Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyAttribute
static PyAttribute createFromCapsule (const nanobind::object &capsule)
 Creates a PyAttribute from the MlirAttribute wrapped by a capsule.

Additional Inherited Members

Public Types inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedT >
using ClassTy
using IsAFunctionTy
using GetTypeIDFunctionTy
using Base
Static Public Attributes inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedT >
static constexpr GetTypeIDFunctionTy getTypeIdFunction
static const MlirStringRef name

Detailed Description

template<typename EltTy, typename DerivedT>
class mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseArrayAttribute< EltTy, DerivedT >

A python-wrapped dense array attribute with an element type and a derived implementation class.

Definition at line 118 of file IRAttributes.h.

Member Function Documentation

◆ bindDerived()

template<typename EltTy, typename DerivedT>
void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseArrayAttribute< EltTy, DerivedT >::bindDerived ( typename PyConcreteAttribute< DerivedT >::ClassTy & c)
inlinestatic

Bind the attribute class.

Definition at line 157 of file IRAttributes.h.

References mlirDenseArrayGetNumElements(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::pyTryCast().

◆ getItem()

template<typename EltTy, typename DerivedT>
EltTy mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseArrayAttribute< EltTy, DerivedT >::getItem ( intptr_t i)
inline

Get the element at the given index.

Definition at line 154 of file IRAttributes.h.


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