Skip to content

Commit

Permalink
[examples][MLIRPython] reformat python code using black
Browse files Browse the repository at this point in the history
  • Loading branch information
xTayEx committed Oct 14, 2023
1 parent dd326d5 commit c736bb9
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 201 deletions.
4 changes: 0 additions & 4 deletions examples/MLIRPython/.style.yapf

This file was deleted.

6 changes: 3 additions & 3 deletions examples/MLIRPython/addmm.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from buddy.compiler import DynamoCompiler
from buddy.compiler import dynamo_compiler
import torch
import torch._dynamo as dynamo


def foo(c, a, b):
return torch.addmm(c, a, b)
return torch.addmm(c, a, b)


foo_mlir = dynamo.optimize(DynamoCompiler)(foo)
foo_mlir = dynamo.optimize(dynamo_compiler)(foo)

a_float32 = torch.randn(3, 2)
b_float32 = torch.randn(2, 3)
Expand Down
4 changes: 2 additions & 2 deletions examples/MLIRPython/arith_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@


def foo(x, y):
return x + y
return x + y


foo_mlir = dynamo.optimize(compiler.DynamoCompiler)(foo)
foo_mlir = dynamo.optimize(compiler.dynamo_compiler)(foo)
float32_in1 = torch.randn(10).to(torch.float32)
float32_in2 = torch.randn(10).to(torch.float32)
foo_mlir(float32_in1, float32_in2)
Expand Down
Loading

0 comments on commit c736bb9

Please sign in to comment.