MLIR 23.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute Class Reference

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

Inheritance diagram for mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute:

Public Member Functions

intptr_t dunderLen () const
std::unique_ptr< nb_buffer_infoaccessBuffer ()
 PyConcreteAttribute ()=default
 PyConcreteAttribute (PyMlirContextRef contextRef, MlirAttribute attr)
 PyConcreteAttribute (PyAttribute &orig)
Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< PyDenseElementsAttribute >
 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 PyDenseElementsAttribute getFromList (const nanobind::typed< nanobind::sequence, PyAttribute > &attributes, std::optional< PyType > explicitType, DefaultingPyMlirContext contextWrapper)
static PyDenseElementsAttribute getFromBuffer (const nb_buffer &array, bool signless, const std::optional< PyType > &explicitType, std::optional< std::vector< int64_t > > explicitShape, DefaultingPyMlirContext contextWrapper)
static PyDenseElementsAttribute getSplat (const PyType &shapedType, PyAttribute &elementAttr)
static void bindDerived (ClassTy &c)
Static Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< PyDenseElementsAttribute >
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.

Static Public Attributes

static constexpr IsAFunctionTy isaFunction = mlirAttributeIsADenseElements
static constexpr const char * pyClassName = "DenseElementsAttr"
static PyType_Slot slots []
Static Public Attributes inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< PyDenseElementsAttribute >
static constexpr GetTypeIDFunctionTy getTypeIdFunction
static const MlirStringRef name

Static Protected Member Functions

template<typename ClassT>
static void bindFactoryMethods (ClassT &c, const char *pyClassName)
 Registers get/get_splat factory methods with the concrete return type in the nb::sig.

Additional Inherited Members

Public Types inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< PyDenseElementsAttribute >
using ClassTy
using IsAFunctionTy
using GetTypeIDFunctionTy
using Base

Detailed Description

Definition at line 398 of file IRAttributes.h.

Member Function Documentation

◆ accessBuffer()

◆ bindDerived()

◆ bindFactoryMethods()

template<typename ClassT>
void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::bindFactoryMethods ( ClassT & c,
const char * pyClassName )
staticprotected

Registers get/get_splat factory methods with the concrete return type in the nb::sig.

Subclasses call this from their bindDerived to override the return type in generated stubs.

Definition at line 776 of file IRAttributes.cpp.

References getFromBuffer(), getFromList(), getSplat(), kDenseElementsAttrGetDocstring, kDenseElementsAttrGetFromListDocstring, and pyClassName.

Referenced by bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseFPElementsAttribute::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseIntElementsAttribute::bindDerived().

◆ dunderLen()

◆ getFromBuffer()

PyDenseElementsAttribute mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::getFromBuffer ( const nb_buffer & array,
bool signless,
const std::optional< PyType > & explicitType,
std::optional< std::vector< int64_t > > explicitShape,
DefaultingPyMlirContext contextWrapper )
static

Definition at line 632 of file IRAttributes.cpp.

References mlir::python::Defaulting< DerivedTy, T >::get().

Referenced by bindFactoryMethods().

◆ getFromList()

PyDenseElementsAttribute mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::getFromList ( const nanobind::typed< nanobind::sequence, PyAttribute > & attributes,
std::optional< PyType > explicitType,
DefaultingPyMlirContext contextWrapper )
static

◆ getSplat()

◆ PyConcreteAttribute() [1/3]

◆ PyConcreteAttribute() [2/3]

Definition at line 1081 of file IRCore.h.

◆ PyConcreteAttribute() [3/3]

mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedTy, BaseTy >::PyConcreteAttribute ( PyMlirContextRef contextRef,
MlirAttribute attr )
inline

Definition at line 1079 of file IRCore.h.

Member Data Documentation

◆ isaFunction

IsAFunctionTy mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::isaFunction = mlirAttributeIsADenseElements
staticconstexpr

Definition at line 401 of file IRAttributes.h.

◆ pyClassName

const char* mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::pyClassName = "DenseElementsAttr"
staticconstexpr

Definition at line 402 of file IRAttributes.h.

Referenced by bindDerived(), and bindFactoryMethods().

◆ slots

PyType_Slot mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDenseElementsAttribute::slots
static
Initial value:
= {
{Py_bf_getbuffer,
reinterpret_cast<void *>(PyDenseElementsAttribute::bf_getbuffer)},
{Py_bf_releasebuffer,
reinterpret_cast<void *>(PyDenseElementsAttribute::bf_releasebuffer)},
{0, nullptr},
}

Definition at line 425 of file IRAttributes.h.

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


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