8000 added some missing attribute annotations + formatting · pytorch/pytorch@73f160e · GitHub
[go: up one dir, main page]

Skip to content

Commit 73f160e

Browse files
added some missing attribute annotations + formatting
1 parent 480a5a0 commit 73f160e

25 files changed

+31
-0
lines changed

torch/distributions/binomial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class Binomial(Distribution):
5454
}
5555
has_enumerate_support: bool = True
5656

57+
total_count: Tensor
58+
5759
def __init__(
5860
self,
5961
total_count: Union[Tensor, int] = 1,

torch/distributions/dirichlet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Dirichlet(ExponentialFamily):
5858
}
5959
support: ClassVar[constraints.Simplex] = constraints.simplex
6060
has_rsample: bool = True
61+
6162
concentration: Tensor
6263

6364
def __init__(

torch/distributions/exponential.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Exponential(ExponentialFamily):
3434
support: ClassVar[constraints.NonNegative] = constraints.nonnegative
3535
has_rsample: bool = True
3636
_mean_carrier_measure: float = 0
37+
3738
rate: Tensor
3839

3940
@property

torch/distributions/fishersnedecor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class FisherSnedecor(Distribution):
3636
}
3737
support: ClassVar[constraints.Positive] = constraints.positive
3838
has_rsample: bool = True
39+
3940
df1: Tensor
4041
df2: Tensor
4142

torch/distributions/gamma.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Gamma(ExponentialFamily):
4242
support: ClassVar[constraints.NonNegative] = constraints.nonnegative
4343
has_rsample: bool = True
4444
_mean_carrier_measure: float = 0
45+
4546
concentration: Tensor
4647
rate: Tensor
4748

torch/distributions/generalized_pareto.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class GeneralizedPareto(Distribution):
4444
}
4545
has_rsample: bool = True
4646

47+
loc: Tensor
48+
scale: Tensor
49+
concentration: Tensor
50+
4751
def __init__(
4852
self,
4953
loc: Union[float, Tensor],

torch/distributions/gumbel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class Gumbel(TransformedDistribution):
3838
}
3939
support: ClassVar[constraints.Real] = constraints.real # type: ignore[assignment]
4040

41+
loc: Tensor
42+
scale: Tensor
43+
4144
def __init__(
4245
self,
4346
loc: Union[Tensor, float],

torch/distributions/half_normal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class HalfNormal(TransformedDistribution):
3838
}
3939
support: ClassVar[constraints.NonNegative] = constraints.nonnegative # type: ignore[assignment]
4040
has_rsample: bool = True
41+
4142
base_dist: Normal
4243

4344
def __init__(

torch/distributions/independent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Independent(Distribution, Generic[D]):
4747
"""
4848

4949
arg_constraints: ClassVar[dict[str, Constraint]] = {}
50+
5051
base_dist: D
5152

5253
def __init__(

torch/distributions/inverse_gamma.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class InverseGamma(TransformedDistribution):
4242
}
4343
support: ClassVar[constraints.Positive] = constraints.positive # type: ignore[assignment]
4444
has_rsample: bool = True
45+
4546
base_dist: Gamma
4647

4748
def __init__(

0 commit comments

Comments
 (0)
0