mlir.dialects._complex_ops_gen ============================== .. py:module:: mlir.dialects._complex_ops_gen Attributes ---------- .. autoapisummary:: mlir.dialects._complex_ops_gen._ods_ir Classes ------- .. autoapisummary:: mlir.dialects._complex_ops_gen._Dialect mlir.dialects._complex_ops_gen.AbsOp mlir.dialects._complex_ops_gen.AddOp mlir.dialects._complex_ops_gen.AngleOp mlir.dialects._complex_ops_gen.Atan2Op mlir.dialects._complex_ops_gen.BitcastOp mlir.dialects._complex_ops_gen.ConjOp mlir.dialects._complex_ops_gen.ConstantOp mlir.dialects._complex_ops_gen.CosOp mlir.dialects._complex_ops_gen.CreateOp mlir.dialects._complex_ops_gen.DivOp mlir.dialects._complex_ops_gen.EqualOp mlir.dialects._complex_ops_gen.ExpOp mlir.dialects._complex_ops_gen.Expm1Op mlir.dialects._complex_ops_gen.ImOp mlir.dialects._complex_ops_gen.Log1pOp mlir.dialects._complex_ops_gen.LogOp mlir.dialects._complex_ops_gen.MulOp mlir.dialects._complex_ops_gen.NegOp mlir.dialects._complex_ops_gen.NotEqualOp mlir.dialects._complex_ops_gen.PowOp mlir.dialects._complex_ops_gen.PowiOp mlir.dialects._complex_ops_gen.ReOp mlir.dialects._complex_ops_gen.RsqrtOp mlir.dialects._complex_ops_gen.SignOp mlir.dialects._complex_ops_gen.SinOp mlir.dialects._complex_ops_gen.SqrtOp mlir.dialects._complex_ops_gen.SubOp mlir.dialects._complex_ops_gen.TanOp mlir.dialects._complex_ops_gen.TanhOp Functions --------- .. autoapisummary:: mlir.dialects._complex_ops_gen.abs mlir.dialects._complex_ops_gen.add mlir.dialects._complex_ops_gen.angle mlir.dialects._complex_ops_gen.atan2 mlir.dialects._complex_ops_gen.bitcast mlir.dialects._complex_ops_gen.conj mlir.dialects._complex_ops_gen.constant mlir.dialects._complex_ops_gen.cos mlir.dialects._complex_ops_gen.create_ mlir.dialects._complex_ops_gen.div mlir.dialects._complex_ops_gen.eq mlir.dialects._complex_ops_gen.exp mlir.dialects._complex_ops_gen.expm1 mlir.dialects._complex_ops_gen.im mlir.dialects._complex_ops_gen.log1p mlir.dialects._complex_ops_gen.log mlir.dialects._complex_ops_gen.mul mlir.dialects._complex_ops_gen.neg mlir.dialects._complex_ops_gen.neq mlir.dialects._complex_ops_gen.pow mlir.dialects._complex_ops_gen.powi mlir.dialects._complex_ops_gen.re mlir.dialects._complex_ops_gen.rsqrt mlir.dialects._complex_ops_gen.sign mlir.dialects._complex_ops_gen.sin mlir.dialects._complex_ops_gen.sqrt mlir.dialects._complex_ops_gen.sub mlir.dialects._complex_ops_gen.tan mlir.dialects._complex_ops_gen.tanh Module Contents --------------- .. py:data:: _ods_ir .. py:class:: _Dialect(descriptor: object) Bases: :py:obj:`_ods_ir` .. py:attribute:: DIALECT_NAMESPACE :value: 'complex' .. py:class:: AbsOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``abs`` op takes a single complex number and computes its absolute value. Example: .. code:: mlir %a = complex.abs %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.abs' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: abs(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: AddOp(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``add`` operation takes two complex numbers and returns their sum. Example: .. code:: mlir %a = complex.add %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.add' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: add(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: AngleOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``angle`` op takes a single complex number and computes its argument value with a branch cut along the negative real axis. Example: .. code:: mlir %a = complex.angle %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.angle' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: angle(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: Atan2Op(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` For complex numbers it is expressed using complex logarithm atan2(y, x) = -i * log((x + i * y) / sqrt(x**2 + y**2)) Example: .. code:: mlir %a = complex.atan2 %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.atan2' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: atan2(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: BitcastOp(result, operand, *, loc=None, ip=None) Bases: :py:obj:`_ods_ir` Example: .. code:: mlir %a = complex.bitcast %b : complex -> i64 .. py:attribute:: OPERATION_NAME :value: 'complex.bitcast' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: operand() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: bitcast(result, operand, *, loc=None, ip=None) -> _ods_ir .. py:class:: ConjOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``conj`` op takes a single complex number and computes the complex conjugate. Example: .. code:: mlir %a = complex.conj %b: complex .. py:attribute:: OPERATION_NAME :value: 'complex.conj' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: conj(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: ConstantOp(complex, value, *, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``complex.constant`` operation creates a constant complex number from an attribute containing the real and imaginary parts. Example: .. code:: mlir %a = complex.constant [0.1, -1.0] : complex .. py:attribute:: OPERATION_NAME :value: 'complex.constant' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: value() -> _ods_ir .. py:method:: complex() -> _ods_ir .. py:function:: constant(complex, value, *, loc=None, ip=None) -> _ods_ir .. py:class:: CosOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``cos`` op takes a single complex number and computes the cosine of it, i.e. ``cos(x)``, where ``x`` is the input value. Example: .. code:: mlir %a = complex.cos %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.cos' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: cos(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: CreateOp(complex, real, imaginary, *, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``complex.create`` operation creates a complex number from two floating-point operands, the real and the imaginary part. Example: .. code:: mlir %a = complex.create %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.create' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: real() -> _ods_ir .. py:method:: imaginary() -> _ods_ir .. py:method:: complex() -> _ods_ir .. py:function:: create_(complex, real, imaginary, *, loc=None, ip=None) -> _ods_ir .. py:class:: DivOp(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``div`` operation takes two complex numbers and returns result of their division: .. code:: mlir %a = complex.div %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.div' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: div(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: EqualOp(lhs, rhs, *, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``eq`` op takes two complex numbers and returns whether they are equal. Example: .. code:: mlir %a = complex.eq %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.eq' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: eq(lhs, rhs, *, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: ExpOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``exp`` op takes a single complex number and computes the exponential of it, i.e. ``exp(x)`` or ``e^(x)``, where ``x`` is the input value. ``e`` denotes Euler's number and is approximately equal to 2.718281. Example: .. code:: mlir %a = complex.exp %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.exp' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: exp(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: Expm1Op(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` complex.expm1(x) := complex.exp(x) - 1 Example: .. code:: mlir %a = complex.expm1 %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.expm1' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: expm1(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: ImOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``im`` op takes a single complex number and extracts the imaginary part. Example: .. code:: mlir %a = complex.im %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.im' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: imaginary() -> _ods_ir .. py:function:: im(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: Log1pOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``log`` op takes a single complex number and computes the natural logarithm of one plus the given value, i.e. ``log(1 + x)`` or ``log_e(1 + x)``, where ``x`` is the input value. ``e`` denotes Euler's number and is approximately equal to 2.718281. Example: .. code:: mlir %a = complex.log1p %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.log1p' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: log1p(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: LogOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``log`` op takes a single complex number and computes the natural logarithm of it, i.e. ``log(x)`` or ``log_e(x)``, where ``x`` is the input value. ``e`` denotes Euler's number and is approximately equal to 2.718281. Example: .. code:: mlir %a = complex.log %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.log' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: log(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: MulOp(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``mul`` operation takes two complex numbers and returns their product: .. code:: mlir %a = complex.mul %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.mul' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: mul(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: NegOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``neg`` op takes a single complex number ``complex`` and returns ``-complex``. Example: .. code:: mlir %a = complex.neg %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.neg' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: neg(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: NotEqualOp(lhs, rhs, *, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``neq`` op takes two complex numbers and returns whether they are not equal. Example: .. code:: mlir %a = complex.neq %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.neq' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: neq(lhs, rhs, *, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: PowOp(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``pow`` operation takes a complex number raises it to the given complex exponent. Example: .. code:: mlir %a = complex.pow %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.pow' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: pow(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: PowiOp(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``powi`` operation takes a ``base`` operand of complex type and a ``power`` operand of signed integer type and returns one result of the same type as ``base``. The result is ``base`` raised to the power of ``power``. Example: .. code:: mlir %a = complex.powi %b, %c : complex, i32 .. py:attribute:: OPERATION_NAME :value: 'complex.powi' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> Optional[_ods_ir] .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: powi(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: ReOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``re`` op takes a single complex number and extracts the real part. Example: .. code:: mlir %a = complex.re %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.re' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: real() -> _ods_ir .. py:function:: re(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: RsqrtOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``rsqrt`` operation computes reciprocal of square root. Example: .. code:: mlir %a = complex.rsqrt %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.rsqrt' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: rsqrt(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: SignOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``sign`` op takes a single complex number and computes the sign of it, i.e. ``y = sign(x) = x / |x|`` if ``x != 0``, otherwise ``y = 0``. Example: .. code:: mlir %a = complex.sign %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.sign' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: sign(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: SinOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``sin`` op takes a single complex number and computes the sine of it, i.e. ``sin(x)``, where ``x`` is the input value. Example: .. code:: mlir %a = complex.sin %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.sin' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: sin(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: SqrtOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``sqrt`` operation takes a complex number and returns its square root. Example: .. code:: mlir %a = complex.sqrt %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.sqrt' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: sqrt(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: SubOp(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``sub`` operation takes two complex numbers and returns their difference. Example: .. code:: mlir %a = complex.sub %b, %c : complex .. py:attribute:: OPERATION_NAME :value: 'complex.sub' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: lhs() -> _ods_ir .. py:method:: rhs() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: sub(lhs, rhs, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: TanOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``tan`` op takes a single complex number and computes the tangent of it, i.e. ``tan(x)``, where ``x`` is the input value. Example: .. code:: mlir %a = complex.tan %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.tan' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: tan(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir .. py:class:: TanhOp(complex, *, fastmath=None, results=None, loc=None, ip=None) Bases: :py:obj:`_ods_ir` The ``tanh`` operation takes a complex number and returns its hyperbolic tangent. Example: .. code:: mlir %a = complex.tanh %b : complex .. py:attribute:: OPERATION_NAME :value: 'complex.tanh' .. py:attribute:: _ODS_REGIONS :value: (0, True) .. py:method:: complex() -> _ods_ir .. py:method:: fastmath() -> _ods_ir .. py:method:: result() -> _ods_ir Shortcut to get an op result if it has only one (throws an error otherwise). .. py:function:: tanh(complex, *, fastmath=None, results=None, loc=None, ip=None) -> _ods_ir