[Mlir-commits] [mlir] [python] fix enum collision (PR #117918)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Nov 27 14:58:27 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r 9d55e862d938c17a5e3f970326139c53b9aaf37e...5d3785efd8e89a0f98150ca97a70b271d30522c7 mlir/python/mlir/dialects/_ods_common.py mlir/python/mlir/dialects/amdgpu.py mlir/python/mlir/dialects/arith.py mlir/python/mlir/dialects/bufferization.py mlir/python/mlir/dialects/gpu/__init__.py mlir/python/mlir/dialects/index.py mlir/python/mlir/dialects/linalg/__init__.py mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py mlir/python/mlir/dialects/llvm.py mlir/python/mlir/dialects/nvgpu.py mlir/python/mlir/dialects/nvvm.py mlir/python/mlir/dialects/sparse_tensor.py mlir/python/mlir/dialects/transform/__init__.py mlir/python/mlir/dialects/transform/extras/__init__.py mlir/python/mlir/dialects/transform/structured.py mlir/python/mlir/dialects/transform/vector.py mlir/python/mlir/dialects/vector.py mlir/python/mlir/ir.py mlir/test/python/dialects/index_dialect.py mlir/test/python/dialects/transform_structured_ext.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py 2024-11-27 22:50:37.000000 +0000
+++ python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py 2024-11-27 22:57:58.314636 +0000
@@ -1081,23 +1081,20 @@
Numeric casting is performed on the operands to the inner multiply, promoting
them to the same data type as the accumulator/output.
"""
implements(ConvolutionOpInterface)
domain(D.n, D.od, D.oh, D.ow, D.f, D.kd, D.kh, D.kw, D.c)
- O[D.n, D.od, D.oh, D.ow, D.f] += (
- TypeFn.cast_signed(
- U,
- I[
- D.n,
- D.od * S.SD + D.kd * S.DD,
- D.oh * S.SH + D.kh * S.DH,
- D.ow * S.SW + D.kw * S.DW,
- D.c,
- ],
- )
- * TypeFn.cast_signed(U, K[D.kd, D.kh, D.kw, D.c, D.f])
- )
+ O[D.n, D.od, D.oh, D.ow, D.f] += TypeFn.cast_signed(
+ U,
+ I[
+ D.n,
+ D.od * S.SD + D.kd * S.DD,
+ D.oh * S.SH + D.kh * S.DH,
+ D.ow * S.SW + D.kw * S.DW,
+ D.c,
+ ],
+ ) * TypeFn.cast_signed(U, K[D.kd, D.kh, D.kw, D.c, D.f])
@linalg_structured_op
def conv_3d_ndhwc_dhwcf_q(
I=TensorDef(
@@ -1161,23 +1158,20 @@
Numeric casting is performed on the operands to the inner multiply, promoting
them to the same data type as the accumulator/output.
"""
implements(ConvolutionOpInterface)
domain(D.n, D.od, D.oh, D.ow, D.f, D.kd, D.kh, D.kw, D.c)
- O[D.n, D.f, D.od, D.oh, D.ow] += (
- TypeFn.cast_signed(
- U,
- I[
- D.n,
- D.c,
- D.od * S.SD + D.kd * S.DD,
- D.oh * S.SH + D.kh * S.DH,
- D.ow * S.SW + D.kw * S.DW,
- ],
- )
- * TypeFn.cast_signed(U, K[D.f, D.c, D.kd, D.kh, D.kw])
- )
+ O[D.n, D.f, D.od, D.oh, D.ow] += TypeFn.cast_signed(
+ U,
+ I[
+ D.n,
+ D.c,
+ D.od * S.SD + D.kd * S.DD,
+ D.oh * S.SH + D.kh * S.DH,
+ D.ow * S.SW + D.kw * S.DW,
+ ],
+ ) * TypeFn.cast_signed(U, K[D.f, D.c, D.kd, D.kh, D.kw])
@linalg_structured_op
def depthwise_conv_1d_nwc_wc(
I=TensorDef(T1, S.N, S.OW * S.SW + S.KW * S.DW, S.IC),
@@ -1373,23 +1367,20 @@
them to the same data type as the accumulator/output. Multiplier is set to 1
which is a special case for most depthwise convolutions.
"""
implements(ConvolutionOpInterface)
domain(D.n, D.od, D.oh, D.ow, D.kd, D.kh, D.kw, D.ic)
- O[D.n, D.od, D.oh, D.ow, D.ic] += (
- TypeFn.cast_signed(
- U,
- I[
- D.n,
- D.od * S.SD + D.kd * S.DD,
- D.oh * S.SH + D.kh * S.DH,
- D.ow * S.SW + D.kw * S.DW,
- D.ic,
- ],
- )
- * TypeFn.cast_signed(U, K[D.kd, D.kh, D.kw, D.ic])
- )
+ O[D.n, D.od, D.oh, D.ow, D.ic] += TypeFn.cast_signed(
+ U,
+ I[
+ D.n,
+ D.od * S.SD + D.kd * S.DD,
+ D.oh * S.SH + D.kh * S.DH,
+ D.ow * S.SW + D.kw * S.DW,
+ D.ic,
+ ],
+ ) * TypeFn.cast_signed(U, K[D.kd, D.kh, D.kw, D.ic])
@linalg_structured_op
def depthwise_conv_3d_ncdhw_cdhw(
I=TensorDef(
@@ -1411,23 +1402,20 @@
them to the same data type as the accumulator/output. Multiplier is set to 1
which is a special case for most depthwise convolutions.
"""
implements(ConvolutionOpInterface)
domain(D.n, D.od, D.oh, D.ow, D.kd, D.kh, D.kw, D.ic)
- O[D.n, D.ic, D.od, D.oh, D.ow] += (
- TypeFn.cast_signed(
- U,
- I[
- D.n,
- D.ic,
- D.od * S.SD + D.kd * S.DD,
- D.oh * S.SH + D.kh * S.DH,
- D.ow * S.SW + D.kw * S.DW,
- ],
- )
- * TypeFn.cast_signed(U, K[D.ic, D.kd, D.kh, D.kw])
- )
+ O[D.n, D.ic, D.od, D.oh, D.ow] += TypeFn.cast_signed(
+ U,
+ I[
+ D.n,
+ D.ic,
+ D.od * S.SD + D.kd * S.DD,
+ D.oh * S.SH + D.kh * S.DH,
+ D.ow * S.SW + D.kw * S.DW,
+ ],
+ ) * TypeFn.cast_signed(U, K[D.ic, D.kd, D.kh, D.kw])
@linalg_structured_op
def depthwise_conv_3d_ndhwc_dhwcm(
I=TensorDef(
@@ -1448,23 +1436,20 @@
Numeric casting is performed on the operands to the inner multiply, promoting
them to the same data type as the accumulator/output.
"""
implements(ConvolutionOpInterface)
domain(D.n, D.od, D.oh, D.ow, D.cm, D.kd, D.kh, D.kw, D.ic)
- O[D.n, D.od, D.oh, D.ow, D.ic, D.cm] += (
- TypeFn.cast_signed(
- U,
- I[
- D.n,
- D.od * S.SD + D.kd * S.DD,
- D.oh * S.SH + D.kh * S.DH,
- D.ow * S.SW + D.kw * S.DW,
- D.ic,
- ],
- )
- * TypeFn.cast_signed(U, K[D.kd, D.kh, D.kw, D.ic, D.cm])
- )
+ O[D.n, D.od, D.oh, D.ow, D.ic, D.cm] += TypeFn.cast_signed(
+ U,
+ I[
+ D.n,
+ D.od * S.SD + D.kd * S.DD,
+ D.oh * S.SH + D.kh * S.DH,
+ D.ow * S.SW + D.kw * S.DW,
+ D.ic,
+ ],
+ ) * TypeFn.cast_signed(U, K[D.kd, D.kh, D.kw, D.ic, D.cm])
@linalg_structured_op
def pooling_nhwc_sum(
I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW, S.C),
``````````
</details>
https://github.com/llvm/llvm-project/pull/117918
More information about the Mlir-commits
mailing list