Skip to content

Commit 8248e98

Browse files
committed
fix format
1 parent a44f3dd commit 8248e98

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/flag_gems/ops/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@
230230
)
231231
from flag_gems.ops.zeros import zeros
232232
from flag_gems.ops.zeros_like import zeros_like
233-
from flag_gems.ops.conv1d import conv1d
234-
from flag_gems.ops.conv2d import conv2d
235-
from flag_gems.ops.conv3d import conv3d
236233

237234
__all__ = [
238235
"_conv_depthwise2d",

src/flag_gems/ops/conv1d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def conv1d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1):
1414
stride_width = stride
1515

1616
if (padding == "same"):
17-
assert stride == 1, "Doesn't support any stride values other than 1 in padding = 'same' mode, received stride value {stride}"
17+
assert stride == 1, "Doesn't support any stride values other than 1 \
18+
in padding = 'same' mode, received stride value {stride}"
1819
il = input.shape[-1]
1920
kernel_size = weight.shape[-1]
2021
padding_width = math.ceil((stride * (il - 1) + 1 + dilation * (kernel_size - 1) - il) / 2)

src/flag_gems/ops/conv2d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,8 @@ def backward(ctx, out_grad):
593593
# todo test SymInt[2] of stride or padding
594594
def conv2d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1):
595595
if (padding == "same"):
596-
assert stride == 1, "Doesn't support any stride values other than 1 in padding = 'same' mode, received stride value {stride}"
596+
assert stride == 1, "Doesn't support any stride values other than 1 \
597+
in padding = 'same' mode, received stride value {stride}"
597598
ih = input.shape[-2]
598599
iw = input.shape[-1]
599600
kernel_size_h = weight.shape[-2]

src/flag_gems/ops/conv3d.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,13 @@ def conv3d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1):
237237
if isinstance(stride, (list, tuple)):
238238
stride_depth, stride_height, stride_width = stride
239239
if (padding == "same"):
240-
assert (stride_depth == 1 and stride_height == 1 and stride_width == 1), "Doesn't support any stride values other than 1 in padding = 'same' mode, received stride value {stride}"
240+
assert (stride_depth == 1 and stride_height == 1 and stride_width == 1), "Doesn't \
241+
support any stride values other than 1 in padding = 'same' mode, received stride value {stride}"
241242
else:
242243
stride_depth = stride_height = stride_width = stride
243244
if (padding == "same"):
244-
assert stride == 1, "Doesn't support any stride values other than 1 in padding = 'same' mode, received stride value {stride}"
245+
assert stride == 1, "Doesn't support any stride values other than 1 \
246+
in padding = 'same' mode, received stride value {stride}"
245247

246248
if isinstance(dilation, (list, tuple)):
247249
dilation_depth, dilation_height, dilation_width = dilation

tests/test_convolution_ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_accuracy_conv1d(shape, kernel, stride, padding, dtype):
4343
if flag_gems.vendor_name == "mthreads" and dtype == torch.float16:
4444
del os.environ["MUSA_ENABLE_SQMMA"]
4545

46+
4647
@pytest.mark.skipif(flag_gems.vendor_name == "kunlunxin", reason="RESULT TODOFIX")
4748
@pytest.mark.conv1d_padding
4849
@pytest.mark.parametrize("shape, kernel", SHAPE_CONV1D)
@@ -169,6 +170,7 @@ def test_accuracy_conv2d(shape, kernel, stride, padding, groups, dtype, dilation
169170
if flag_gems.vendor_name == "mthreads" and dtype == torch.float16:
170171
del os.environ["MUSA_ENABLE_SQMMA"]
171172

173+
172174
@pytest.mark.skipif(flag_gems.vendor_name == "hygon", reason="RESULT TODOFIX")
173175
@pytest.mark.skipif(flag_gems.vendor_name == "kunlunxin", reason="RESULT TODOFIX")
174176
@pytest.mark.conv2d_padding

0 commit comments

Comments
 (0)