Skip to content

Commit d5e9c75

Browse files
committed
format
1 parent c250004 commit d5e9c75

5 files changed

Lines changed: 17 additions & 20 deletions

File tree

python/infinicore/nn/functional/glu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55

66
def glu(input: Tensor, dim: int = -1) -> Tensor:
7-
87
if infinicore.use_ntops and input.device.type in ("cuda", "musa"):
98
return infinicore.ntops.torch.glu(input, dim)
109

11-
return Tensor(_infinicore.glu(input._underlying, dim))
10+
return Tensor(_infinicore.glu(input._underlying, dim))

python/infinicore/nn/functional/nll_loss.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def nll_loss(
1212
*,
1313
out=None,
1414
) -> Tensor:
15-
1615
if infinicore.use_ntops and input.device.type in ("cuda", "musa"):
1716
return infinicore.ntops.torch.nll_loss(
1817
input, target, weight=weight, ignore_index=ignore_index, reduction=reduction
@@ -23,18 +22,15 @@ def nll_loss(
2322
if out is None:
2423
return Tensor(
2524
_infinicore.nll_loss(
26-
input._underlying,
27-
target._underlying,
28-
weight_underlying,
29-
ignore_index
25+
input._underlying, target._underlying, weight_underlying, ignore_index
3026
)
3127
)
32-
28+
3329
_infinicore.nll_loss_(
34-
input._underlying,
35-
target._underlying,
36-
weight_underlying,
37-
out._underlying,
38-
ignore_index
30+
input._underlying,
31+
target._underlying,
32+
weight_underlying,
33+
out._underlying,
34+
ignore_index,
3935
)
40-
return out
36+
return out

python/infinicore/ops/gcd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
def gcd(input: Tensor, other: Tensor, *, out=None) -> Tensor:
77
r"""Computes the element-wise greatest common divisor (GCD)."""
8-
8+
99
if infinicore.use_ntops and input.device.type in ("cuda", "musa"):
1010
return infinicore.ntops.torch.gcd(input, other, out=out)
1111

1212
if out is None:
1313
return Tensor(_infinicore.gcd(input._underlying, other._underlying))
14-
14+
1515
_infinicore.gcd_(input._underlying, other._underlying, out._underlying)
16-
return out
16+
return out

python/infinicore/ops/gt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ def gt(input: Tensor, other: Tensor | float, *, out: Tensor | None = None) -> Te
1212

1313
if out is None:
1414
return Tensor(_infinicore.gt(input._underlying, other._underlying))
15-
15+
1616
_infinicore.gt_(input._underlying, other._underlying, out._underlying)
17-
return out
17+
return out

python/infinicore/ops/select_scatter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ def select_scatter(input: Tensor, src: Tensor, dim: int, index: int) -> Tensor:
77
if infinicore.use_ntops and input.device.type in ("cuda", "musa"):
88
return infinicore.ntops.torch.select_scatter(input, src, dim, index)
99

10-
return Tensor(_infinicore.select_scatter(input._underlying, src._underlying, dim, index))
10+
return Tensor(
11+
_infinicore.select_scatter(input._underlying, src._underlying, dim, index)
12+
)

0 commit comments

Comments
 (0)