Lines Matching refs:py

18 namespace py = pybind11;
91 py::arg("affine_map"), "Gets an attribute wrapping an AffineMap."); in bindDerived()
96 static T pyTryCast(py::handle object) { in pyTryCast()
99 } catch (py::cast_error &err) { in pyTryCast()
104 throw py::cast_error(msg); in pyTryCast()
105 } catch (py::reference_cast_error &err) { in pyTryCast()
109 throw py::cast_error(msg); in pyTryCast()
127 throw py::stop_iteration(); in dunderNext()
133 static void bind(py::module &m) { in bind()
134 py::class_<PyArrayAttributeIterator>(m, "ArrayAttributeIterator", in bind()
135 py::module_local()) in bind()
152 [](py::list attributes, DefaultingPyMlirContext context) { in bindDerived()
154 mlirAttributes.reserve(py::len(attributes)); in bindDerived()
162 py::arg("attributes"), py::arg("context") = py::none(), in bindDerived()
167 throw py::index_error("ArrayAttribute index out of range"); in bindDerived()
177 c.def("__add__", [](PyArrayAttribute arr, py::list extras) { in bindDerived()
180 attributes.reserve(numOldElements + py::len(extras)); in bindDerived()
183 for (py::handle attr : extras) in bindDerived()
209 py::repr(py::cast(type)).cast<std::string>() + in bindDerived()
214 py::arg("type"), py::arg("value"), py::arg("loc") = py::none(), in bindDerived()
223 py::arg("value"), py::arg("context") = py::none(), in bindDerived()
232 py::arg("value"), py::arg("context") = py::none(), in bindDerived()
257 py::arg("type"), py::arg("value"), in bindDerived()
261 [](PyIntegerAttribute &self) -> py::int_ { in bindDerived()
287 py::arg("value"), py::arg("context") = py::none(), in bindDerived()
311 py::arg("value"), py::arg("context") = py::none(), in bindDerived()
317 return py::str(stringRef.data, stringRef.length); in bindDerived()
332 [](std::string dialectNamespace, py::buffer buffer, PyType &type, in bindDerived()
334 const py::buffer_info bufferInfo = buffer.request(); in bindDerived()
341 py::arg("dialect_namespace"), py::arg("buffer"), py::arg("type"), in bindDerived()
342 py::arg("context") = py::none(), "Gets an Opaque attribute."); in bindDerived()
347 return py::str(stringRef.data, stringRef.length); in bindDerived()
354 return py::str(stringRef.data, stringRef.length); in bindDerived()
374 py::arg("value"), py::arg("context") = py::none(), in bindDerived()
383 py::arg("type"), py::arg("value"), in bindDerived()
389 return py::str(stringRef.data, stringRef.length); in bindDerived()
404 getFromBuffer(py::buffer array, bool signless, Optional<PyType> explicitType, in getFromBuffer()
412 throw py::error_already_set(); in getFromBuffer()
414 py::buffer_info arrayInfo(view); in getFromBuffer()
513 message.append(py::repr(py::cast(elementAttr))); in getSplat()
520 message.append(py::repr(py::cast(shapedType))); in getSplat()
528 message.append(py::repr(py::cast(shapedType))); in getSplat()
530 message.append(py::repr(py::cast(elementAttr))); in getSplat()
541 py::buffer_info accessBuffer() { in accessBuffer()
620 py::arg("array"), py::arg("signless") = true, in bindDerived()
621 py::arg("type") = py::none(), py::arg("shape") = py::none(), in bindDerived()
622 py::arg("context") = py::none(), in bindDerived()
625 py::arg("shaped_type"), py::arg("element_attr"), in bindDerived()
652 py::buffer_info bufferInfo(MlirType shapedType, in bufferInfo()
678 format = py::format_descriptor<Type>::format(); in bufferInfo()
680 return py::buffer_info(data, sizeof(Type), format, rank, shape, strides, in bufferInfo()
697 py::int_ dunderGetItem(intptr_t pos) { in dunderGetItem()
773 [](py::dict attributes, DefaultingPyMlirContext context) { in bindDerived()
789 py::arg("value") = py::dict(), py::arg("context") = py::none(), in bindDerived()
823 py::float_ dunderGetItem(intptr_t pos) { in dunderGetItem()
863 py::arg("value"), py::arg("context") = py::none(), in bindDerived()
886 py::arg("context") = py::none(), "Create a Unit attribute."); in bindDerived()
892 void mlir::python::populateIRAttributes(py::module &m) { in populateIRAttributes()