提交 f40302ca 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

Update generated Python Op docs.

Change: 125729946
上级 aafb9be5
......@@ -727,7 +727,7 @@ tf.shape(tf.concat(1, [t3, t4])) ==> [2, 6]
- - -
### `tf.pack(values, name='pack')` {#pack}
### `tf.pack(values, axis=0, name='pack')` {#pack}
Packs a list of rank-`R` tensors into one rank-`(R+1)` tensor.
......@@ -743,6 +743,8 @@ This is the opposite of unpack. The numpy equivalent is
* <b>`values`</b>: A list of `Tensor` objects with the same shape and type.
* <b>`axis`</b>: An `int`. The axis to pack along. Defaults to the first dimension.
Supports negative indexes.
* <b>`name`</b>: A name for this operation (optional).
##### Returns:
......@@ -750,16 +752,21 @@ This is the opposite of unpack. The numpy equivalent is
* <b>`output`</b>: A packed `Tensor` with the same type as `values`.
##### Raises:
* <b>`ValueError`</b>: If `axis` is out of the range [-(R+1), R+1).
- - -
### `tf.unpack(value, num=None, name='unpack')` {#unpack}
### `tf.unpack(value, num=None, axis=0, name='unpack')` {#unpack}
Unpacks the outer dimension of a rank-`R` tensor into rank-`(R-1)` tensors.
Unpacks the given dimension of a rank-`R` tensor into rank-`(R-1)` tensors.
Unpacks `num` tensors from `value` along the first dimension.
Unpacks `num` tensors from `value` along the given dimension.
If `num` is not specified (the default), it is inferred from `value`'s shape.
If `value.shape[0]` is not known, `ValueError` is raised.
If `value.shape[axis]` is not known, `ValueError` is raised.
The ith tensor in `output` is the slice `value[i, ...]`. Each tensor in
`output` has shape `value.shape[1:]`.
......@@ -772,8 +779,10 @@ This is the opposite of pack. The numpy equivalent is
* <b>`value`</b>: A rank `R > 0` `Tensor` to be unpacked.
* <b>`num`</b>: An `int`. The first dimension of value. Automatically inferred if
`None` (the default).
* <b>`num`</b>: An `int`. The length of the dimension `axis`. Automatically inferred
if `None` (the default).
* <b>`axis`</b>: An `int`. The axis to unpack along. Defaults to the first
dimension. Supports negative indexes.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
......@@ -784,6 +793,7 @@ This is the opposite of pack. The numpy equivalent is
* <b>`ValueError`</b>: If `num` is unspecified and cannot be inferred.
* <b>`ValueError`</b>: If `axis` is out of the range [-R, R).
- - -
......
......@@ -255,6 +255,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.BaseDistribution.strict` {#BaseDistribution.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.BaseDistribution.variance(name='variance')` {#BaseDistribution.variance}
......@@ -441,6 +448,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.ContinuousDistribution.strict` {#ContinuousDistribution.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.ContinuousDistribution.variance(name='variance')` {#ContinuousDistribution.variance}
......@@ -613,6 +627,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.DiscreteDistribution.strict` {#DiscreteDistribution.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.DiscreteDistribution.variance(name='variance')` {#DiscreteDistribution.variance}
......@@ -862,6 +883,13 @@ Standard deviation of the distribution.
* <b>`std`</b>: `Tensor` of the same type and shape as `p`.
- - -
#### `tf.contrib.distributions.Bernoulli.strict` {#Bernoulli.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Bernoulli.variance(name='variance')` {#Bernoulli.variance}
......@@ -895,19 +923,20 @@ Note, the following methods of the base class aren't implemented:
* log_cdf
- - -
#### `tf.contrib.distributions.Categorical.__init__(logits, name='Categorical', dtype=tf.int32)` {#Categorical.__init__}
#### `tf.contrib.distributions.Categorical.__init__(logits, dtype=tf.int32, strict=True, name='Categorical')` {#Categorical.__init__}
Initialize Categorical distributions using class log-probabilities.
##### Args:
* <b>`logits`</b>: An N-D `Tensor` representing the log probabilities of a set of
Categorical distributions. The first N - 1 dimensions index into a
batch of independent distributions and the last dimension indexes
into the classes.
* <b>`name`</b>: A name for this distribution (optional).
* <b>`logits`</b>: An N-D `Tensor`, `N >= 1`, representing the log probabilities
of a set of Categorical distributions. The first `N - 1` dimensions
index into a batch of independent distributions and the last dimension
indexes into the classes.
* <b>`dtype`</b>: The type of the event samples (default: int32).
* <b>`strict`</b>: Unused in this distribution.
* <b>`name`</b>: A name for this distribution (optional).
- - -
......@@ -1074,6 +1103,13 @@ Sample `n` observations from the Categorical distribution.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.Categorical.strict` {#Categorical.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Categorical.variance(name='variance')` {#Categorical.variance}
......@@ -1090,16 +1126,26 @@ The Chi2 distribution with degrees of freedom df.
The PDF of this distribution is:
```pdf(x) = (x^(df/2 - 1)e^(-x/2))/(2^(k/2)Gamma(k/2)), x > 0```
```pdf(x) = (x^(df/2 - 1)e^(-x/2))/(2^(df/2)Gamma(df/2)), x > 0```
Note that the Chi2 distribution is a special case of the Gamma distribution,
with Chi2(df) = Gamma(df/2, 1/2).
- - -
#### `tf.contrib.distributions.Chi2.__init__(df, name='Chi2')` {#Chi2.__init__}
#### `tf.contrib.distributions.Chi2.__init__(df, strict=True, name='Chi2')` {#Chi2.__init__}
Construct Chi2 distributions with parameter `df`.
##### Args:
* <b>`df`</b>: `float` or `double` tensor, the degrees of freedom of the
distribution(s). `df` must contain only positive values.
* <b>`strict`</b>: Whether to assert that `df > 0`, and that `x > 0` in the
methods `pdf(x)` and `log_pdf(x)`. If `strict` is False
and the inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prepend to all ops created by this distribution.
- - -
......@@ -1363,6 +1409,13 @@ See the doc for tf.random_gamma for further detail.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Chi2.strict` {#Chi2.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Chi2.variance(name='variance')` {#Chi2.variance}
......@@ -1385,10 +1438,20 @@ Note that the Exponential distribution is a special case of the Gamma
distribution, with Exponential(lam) = Gamma(1, lam).
- - -
#### `tf.contrib.distributions.Exponential.__init__(lam, name='Exponential')` {#Exponential.__init__}
#### `tf.contrib.distributions.Exponential.__init__(lam, strict=True, name='Exponential')` {#Exponential.__init__}
Construct Exponential distribution with parameter `lam`.
##### Args:
* <b>`lam`</b>: `float` or `double` tensor, the rate of the distribution(s).
`lam` must contain only positive values.
* <b>`strict`</b>: Whether to assert that `lam > 0`, and that `x > 0` in the
methods `pdf(x)` and `log_pdf(x)`. If `strict` is False
and the inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prepend to all ops created by this distribution.
- - -
......@@ -1649,6 +1712,13 @@ Sample `n` observations from the Exponential Distributions.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Exponential.strict` {#Exponential.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Exponential.variance(name='variance')` {#Exponential.variance}
......@@ -1683,7 +1753,7 @@ dist2 = Gamma(alpha=[3.0, 4.0], beta=[2.0, 3.0])
```
- - -
#### `tf.contrib.distributions.Gamma.__init__(alpha, beta, name='Gamma')` {#Gamma.__init__}
#### `tf.contrib.distributions.Gamma.__init__(alpha, beta, strict=True, name='Gamma')` {#Gamma.__init__}
Construct Gamma distributions with parameters `alpha` and `beta`.
......@@ -1699,6 +1769,9 @@ broadcasting (e.g. `alpha + beta` is a valid operation).
* <b>`beta`</b>: `float` or `double` tensor, the inverse scale params of the
distribution(s).
beta must contain only positive values.
* <b>`strict`</b>: Whether to assert that `a > 0, b > 0`, and that `x > 0` in the
methods `pdf(x)` and `log_pdf(x)`. If `strict` is False
and the inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prepend to all ops created by this distribution.
##### Raises:
......@@ -1962,6 +2035,13 @@ See the doc for tf.random_gamma for further detail.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Gamma.strict` {#Gamma.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Gamma.variance(name='variance')` {#Gamma.variance}
......@@ -2018,7 +2098,7 @@ dist.pdf(3.0)
```
- - -
#### `tf.contrib.distributions.Normal.__init__(mu, sigma, name='Normal')` {#Normal.__init__}
#### `tf.contrib.distributions.Normal.__init__(mu, sigma, strict=True, name='Normal')` {#Normal.__init__}
Construct Normal distributions with mean and stddev `mu` and `sigma`.
......@@ -2031,6 +2111,8 @@ broadcasting (e.g. `mu + sigma` is a valid operation).
* <b>`mu`</b>: `float` or `double` tensor, the means of the distribution(s).
* <b>`sigma`</b>: `float` or `double` tensor, the stddevs of the distribution(s).
sigma must contain only positive values.
* <b>`strict`</b>: Whether to assert that `sigma > 0`. If `strict` is False,
correct output is not guaranteed when input is invalid.
* <b>`name`</b>: The name to give Ops created by the initializer.
##### Raises:
......@@ -2272,6 +2354,13 @@ Distribution parameter for standard deviation.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Normal.strict` {#Normal.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Normal.variance(name='variance')` {#Normal.variance}
......@@ -2331,7 +2420,7 @@ dist.pdf(3.0)
```
- - -
#### `tf.contrib.distributions.StudentT.__init__(df, mu, sigma, name='StudentT')` {#StudentT.__init__}
#### `tf.contrib.distributions.StudentT.__init__(df, mu, sigma, strict=True, name='StudentT')` {#StudentT.__init__}
Construct Student's t distributions.
......@@ -2349,6 +2438,8 @@ broadcasting (e.g. `df + mu + sigma` is a valid operation).
* <b>`sigma`</b>: `float` or `double` tensor, the scaling factor for the
distribution(s). `sigma` must contain only positive values.
Note that `sigma` is not the standard deviation of this distribution.
* <b>`strict`</b>: Whether to assert that `df > 0, sigma > 0`. If `strict` is False
and inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to give Ops created by the initializer.
##### Raises:
......@@ -2543,6 +2634,13 @@ Scaling factors of these Student's t distribution(s).
- - -
#### `tf.contrib.distributions.StudentT.strict` {#StudentT.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.StudentT.variance(name='variance')` {#StudentT.variance}
......@@ -2560,7 +2658,7 @@ Uniform distribution with `a` and `b` parameters.
The PDF of this distribution is constant between [`a`, `b`], and 0 elsewhere.
- - -
#### `tf.contrib.distributions.Uniform.__init__(a=0.0, b=1.0, name='Uniform')` {#Uniform.__init__}
#### `tf.contrib.distributions.Uniform.__init__(a=0.0, b=1.0, strict=True, name='Uniform')` {#Uniform.__init__}
Construct Uniform distributions with `a` and `b`.
......@@ -2590,12 +2688,14 @@ u1 = Uniform(3.0, [5.0, 6.0, 7.0]) # 3 distributions
* <b>`a`</b>: `float` or `double` tensor, the minimum endpoint.
* <b>`b`</b>: `float` or `double` tensor, the maximum endpoint. Must be > `a`.
* <b>`strict`</b>: Whether to assert that `a > b`. If `strict` is False and inputs
are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prefix Ops created by this distribution class.
##### Raises:
* <b>`InvalidArgumentError`</b>: if `a >= b`.
* <b>`InvalidArgumentError`</b>: if `a >= b` and `strict=True`.
- - -
......@@ -2785,6 +2885,13 @@ Sample `n` observations from the Uniform Distributions.
- - -
#### `tf.contrib.distributions.Uniform.strict` {#Uniform.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Uniform.variance(name='variance')` {#Uniform.variance}
......@@ -3092,7 +3199,7 @@ dist.pmf(counts) # Shape [2]
```
- - -
#### `tf.contrib.distributions.DirichletMultinomial.__init__(n, alpha, name='DirichletMultinomial', allow_arbitrary_counts=False)` {#DirichletMultinomial.__init__}
#### `tf.contrib.distributions.DirichletMultinomial.__init__(n, alpha, allow_arbitrary_counts=False, strict=True, name='DirichletMultinomial')` {#DirichletMultinomial.__init__}
Initialize a batch of DirichletMultinomial distributions.
......@@ -3106,11 +3213,12 @@ Initialize a batch of DirichletMultinomial distributions.
* <b>`alpha`</b>: Positive `float` or `double` tensor with shape broadcastable to
`[N1,..., Nm, k]` `m >= 0`. Defines this as a batch of `N1 x ... x Nm`
different `k` class Dirichlet multinomial distributions.
* <b>`name`</b>: The name to prefix Ops created by this distribution class.
* <b>`allow_arbitrary_counts`</b>: Boolean. This represents whether the pmf/cdf
allows for the `counts` tensor to be non-integral values.
The pmf/cdf are functions that can be evaluated at non-integral values,
but are only a distribution over non-negative integers.
* <b>`strict`</b>: Not used (yet).
* <b>`name`</b>: The name to prefix Ops created by this distribution class.
* <b>`Examples`</b>:
......@@ -3339,6 +3447,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.DirichletMultinomial.strict` {#DirichletMultinomial.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.DirichletMultinomial.variance(name='variance')` {#DirichletMultinomial.variance}
......
......@@ -232,6 +232,13 @@ Standard deviation of the distribution.
* <b>`std`</b>: `Tensor` of the same type and shape as `p`.
- - -
#### `tf.contrib.distributions.Bernoulli.strict` {#Bernoulli.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Bernoulli.variance(name='variance')` {#Bernoulli.variance}
......
......@@ -45,7 +45,7 @@ dist.pdf(3.0)
```
- - -
#### `tf.contrib.distributions.StudentT.__init__(df, mu, sigma, name='StudentT')` {#StudentT.__init__}
#### `tf.contrib.distributions.StudentT.__init__(df, mu, sigma, strict=True, name='StudentT')` {#StudentT.__init__}
Construct Student's t distributions.
......@@ -63,6 +63,8 @@ broadcasting (e.g. `df + mu + sigma` is a valid operation).
* <b>`sigma`</b>: `float` or `double` tensor, the scaling factor for the
distribution(s). `sigma` must contain only positive values.
Note that `sigma` is not the standard deviation of this distribution.
* <b>`strict`</b>: Whether to assert that `df > 0, sigma > 0`. If `strict` is False
and inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to give Ops created by the initializer.
##### Raises:
......@@ -257,6 +259,13 @@ Scaling factors of these Student's t distribution(s).
- - -
#### `tf.contrib.distributions.StudentT.strict` {#StudentT.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.StudentT.variance(name='variance')` {#StudentT.variance}
......
......@@ -9,19 +9,20 @@ Note, the following methods of the base class aren't implemented:
* log_cdf
- - -
#### `tf.contrib.distributions.Categorical.__init__(logits, name='Categorical', dtype=tf.int32)` {#Categorical.__init__}
#### `tf.contrib.distributions.Categorical.__init__(logits, dtype=tf.int32, strict=True, name='Categorical')` {#Categorical.__init__}
Initialize Categorical distributions using class log-probabilities.
##### Args:
* <b>`logits`</b>: An N-D `Tensor` representing the log probabilities of a set of
Categorical distributions. The first N - 1 dimensions index into a
batch of independent distributions and the last dimension indexes
into the classes.
* <b>`name`</b>: A name for this distribution (optional).
* <b>`logits`</b>: An N-D `Tensor`, `N >= 1`, representing the log probabilities
of a set of Categorical distributions. The first `N - 1` dimensions
index into a batch of independent distributions and the last dimension
indexes into the classes.
* <b>`dtype`</b>: The type of the event samples (default: int32).
* <b>`strict`</b>: Unused in this distribution.
* <b>`name`</b>: A name for this distribution (optional).
- - -
......@@ -188,6 +189,13 @@ Sample `n` observations from the Categorical distribution.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.Categorical.strict` {#Categorical.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Categorical.variance(name='variance')` {#Categorical.variance}
......
......@@ -2,16 +2,26 @@ The Chi2 distribution with degrees of freedom df.
The PDF of this distribution is:
```pdf(x) = (x^(df/2 - 1)e^(-x/2))/(2^(k/2)Gamma(k/2)), x > 0```
```pdf(x) = (x^(df/2 - 1)e^(-x/2))/(2^(df/2)Gamma(df/2)), x > 0```
Note that the Chi2 distribution is a special case of the Gamma distribution,
with Chi2(df) = Gamma(df/2, 1/2).
- - -
#### `tf.contrib.distributions.Chi2.__init__(df, name='Chi2')` {#Chi2.__init__}
#### `tf.contrib.distributions.Chi2.__init__(df, strict=True, name='Chi2')` {#Chi2.__init__}
Construct Chi2 distributions with parameter `df`.
##### Args:
* <b>`df`</b>: `float` or `double` tensor, the degrees of freedom of the
distribution(s). `df` must contain only positive values.
* <b>`strict`</b>: Whether to assert that `df > 0`, and that `x > 0` in the
methods `pdf(x)` and `log_pdf(x)`. If `strict` is False
and the inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prepend to all ops created by this distribution.
- - -
......@@ -275,6 +285,13 @@ See the doc for tf.random_gamma for further detail.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Chi2.strict` {#Chi2.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Chi2.variance(name='variance')` {#Chi2.variance}
......
......@@ -3,7 +3,7 @@ Uniform distribution with `a` and `b` parameters.
The PDF of this distribution is constant between [`a`, `b`], and 0 elsewhere.
- - -
#### `tf.contrib.distributions.Uniform.__init__(a=0.0, b=1.0, name='Uniform')` {#Uniform.__init__}
#### `tf.contrib.distributions.Uniform.__init__(a=0.0, b=1.0, strict=True, name='Uniform')` {#Uniform.__init__}
Construct Uniform distributions with `a` and `b`.
......@@ -33,12 +33,14 @@ u1 = Uniform(3.0, [5.0, 6.0, 7.0]) # 3 distributions
* <b>`a`</b>: `float` or `double` tensor, the minimum endpoint.
* <b>`b`</b>: `float` or `double` tensor, the maximum endpoint. Must be > `a`.
* <b>`strict`</b>: Whether to assert that `a > b`. If `strict` is False and inputs
are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prefix Ops created by this distribution class.
##### Raises:
* <b>`InvalidArgumentError`</b>: if `a >= b`.
* <b>`InvalidArgumentError`</b>: if `a >= b` and `strict=True`.
- - -
......@@ -228,6 +230,13 @@ Sample `n` observations from the Uniform Distributions.
- - -
#### `tf.contrib.distributions.Uniform.strict` {#Uniform.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Uniform.variance(name='variance')` {#Uniform.variance}
......
......@@ -172,6 +172,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.ContinuousDistribution.strict` {#ContinuousDistribution.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.ContinuousDistribution.variance(name='variance')` {#ContinuousDistribution.variance}
......
......@@ -67,7 +67,7 @@ dist.pmf(counts) # Shape [2]
```
- - -
#### `tf.contrib.distributions.DirichletMultinomial.__init__(n, alpha, name='DirichletMultinomial', allow_arbitrary_counts=False)` {#DirichletMultinomial.__init__}
#### `tf.contrib.distributions.DirichletMultinomial.__init__(n, alpha, allow_arbitrary_counts=False, strict=True, name='DirichletMultinomial')` {#DirichletMultinomial.__init__}
Initialize a batch of DirichletMultinomial distributions.
......@@ -81,11 +81,12 @@ Initialize a batch of DirichletMultinomial distributions.
* <b>`alpha`</b>: Positive `float` or `double` tensor with shape broadcastable to
`[N1,..., Nm, k]` `m >= 0`. Defines this as a batch of `N1 x ... x Nm`
different `k` class Dirichlet multinomial distributions.
* <b>`name`</b>: The name to prefix Ops created by this distribution class.
* <b>`allow_arbitrary_counts`</b>: Boolean. This represents whether the pmf/cdf
allows for the `counts` tensor to be non-integral values.
The pmf/cdf are functions that can be evaluated at non-integral values,
but are only a distribution over non-negative integers.
* <b>`strict`</b>: Not used (yet).
* <b>`name`</b>: The name to prefix Ops created by this distribution class.
* <b>`Examples`</b>:
......@@ -314,6 +315,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.DirichletMultinomial.strict` {#DirichletMultinomial.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.DirichletMultinomial.variance(name='variance')` {#DirichletMultinomial.variance}
......
......@@ -8,10 +8,20 @@ Note that the Exponential distribution is a special case of the Gamma
distribution, with Exponential(lam) = Gamma(1, lam).
- - -
#### `tf.contrib.distributions.Exponential.__init__(lam, name='Exponential')` {#Exponential.__init__}
#### `tf.contrib.distributions.Exponential.__init__(lam, strict=True, name='Exponential')` {#Exponential.__init__}
Construct Exponential distribution with parameter `lam`.
##### Args:
* <b>`lam`</b>: `float` or `double` tensor, the rate of the distribution(s).
`lam` must contain only positive values.
* <b>`strict`</b>: Whether to assert that `lam > 0`, and that `x > 0` in the
methods `pdf(x)` and `log_pdf(x)`. If `strict` is False
and the inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prepend to all ops created by this distribution.
- - -
......@@ -272,6 +282,13 @@ Sample `n` observations from the Exponential Distributions.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Exponential.strict` {#Exponential.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Exponential.variance(name='variance')` {#Exponential.variance}
......
......@@ -20,7 +20,7 @@ dist2 = Gamma(alpha=[3.0, 4.0], beta=[2.0, 3.0])
```
- - -
#### `tf.contrib.distributions.Gamma.__init__(alpha, beta, name='Gamma')` {#Gamma.__init__}
#### `tf.contrib.distributions.Gamma.__init__(alpha, beta, strict=True, name='Gamma')` {#Gamma.__init__}
Construct Gamma distributions with parameters `alpha` and `beta`.
......@@ -36,6 +36,9 @@ broadcasting (e.g. `alpha + beta` is a valid operation).
* <b>`beta`</b>: `float` or `double` tensor, the inverse scale params of the
distribution(s).
beta must contain only positive values.
* <b>`strict`</b>: Whether to assert that `a > 0, b > 0`, and that `x > 0` in the
methods `pdf(x)` and `log_pdf(x)`. If `strict` is False
and the inputs are invalid, correct behavior is not guaranteed.
* <b>`name`</b>: The name to prepend to all ops created by this distribution.
##### Raises:
......@@ -299,6 +302,13 @@ See the doc for tf.random_gamma for further detail.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Gamma.strict` {#Gamma.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Gamma.variance(name='variance')` {#Gamma.variance}
......
### `tf.pack(values, name='pack')` {#pack}
### `tf.pack(values, axis=0, name='pack')` {#pack}
Packs a list of rank-`R` tensors into one rank-`(R+1)` tensor.
......@@ -14,6 +14,8 @@ This is the opposite of unpack. The numpy equivalent is
* <b>`values`</b>: A list of `Tensor` objects with the same shape and type.
* <b>`axis`</b>: An `int`. The axis to pack along. Defaults to the first dimension.
Supports negative indexes.
* <b>`name`</b>: A name for this operation (optional).
##### Returns:
......@@ -21,3 +23,8 @@ This is the opposite of unpack. The numpy equivalent is
* <b>`output`</b>: A packed `Tensor` with the same type as `values`.
##### Raises:
* <b>`ValueError`</b>: If `axis` is out of the range [-(R+1), R+1).
### `tf.unpack(value, num=None, name='unpack')` {#unpack}
### `tf.unpack(value, num=None, axis=0, name='unpack')` {#unpack}
Unpacks the outer dimension of a rank-`R` tensor into rank-`(R-1)` tensors.
Unpacks the given dimension of a rank-`R` tensor into rank-`(R-1)` tensors.
Unpacks `num` tensors from `value` along the first dimension.
Unpacks `num` tensors from `value` along the given dimension.
If `num` is not specified (the default), it is inferred from `value`'s shape.
If `value.shape[0]` is not known, `ValueError` is raised.
If `value.shape[axis]` is not known, `ValueError` is raised.
The ith tensor in `output` is the slice `value[i, ...]`. Each tensor in
`output` has shape `value.shape[1:]`.
......@@ -17,8 +17,10 @@ This is the opposite of pack. The numpy equivalent is
* <b>`value`</b>: A rank `R > 0` `Tensor` to be unpacked.
* <b>`num`</b>: An `int`. The first dimension of value. Automatically inferred if
`None` (the default).
* <b>`num`</b>: An `int`. The length of the dimension `axis`. Automatically inferred
if `None` (the default).
* <b>`axis`</b>: An `int`. The axis to unpack along. Defaults to the first
dimension. Supports negative indexes.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
......@@ -29,4 +31,5 @@ This is the opposite of pack. The numpy equivalent is
* <b>`ValueError`</b>: If `num` is unspecified and cannot be inferred.
* <b>`ValueError`</b>: If `axis` is out of the range [-R, R).
......@@ -237,6 +237,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.BaseDistribution.strict` {#BaseDistribution.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.BaseDistribution.variance(name='variance')` {#BaseDistribution.variance}
......
......@@ -158,6 +158,13 @@ Generate `n` samples.
Standard deviation of the distribution.
- - -
#### `tf.contrib.distributions.DiscreteDistribution.strict` {#DiscreteDistribution.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.DiscreteDistribution.variance(name='variance')` {#DiscreteDistribution.variance}
......
......@@ -42,7 +42,7 @@ dist.pdf(3.0)
```
- - -
#### `tf.contrib.distributions.Normal.__init__(mu, sigma, name='Normal')` {#Normal.__init__}
#### `tf.contrib.distributions.Normal.__init__(mu, sigma, strict=True, name='Normal')` {#Normal.__init__}
Construct Normal distributions with mean and stddev `mu` and `sigma`.
......@@ -55,6 +55,8 @@ broadcasting (e.g. `mu + sigma` is a valid operation).
* <b>`mu`</b>: `float` or `double` tensor, the means of the distribution(s).
* <b>`sigma`</b>: `float` or `double` tensor, the stddevs of the distribution(s).
sigma must contain only positive values.
* <b>`strict`</b>: Whether to assert that `sigma > 0`. If `strict` is False,
correct output is not guaranteed when input is invalid.
* <b>`name`</b>: The name to give Ops created by the initializer.
##### Raises:
......@@ -296,6 +298,13 @@ Distribution parameter for standard deviation.
Standard deviation of this distribution.
- - -
#### `tf.contrib.distributions.Normal.strict` {#Normal.strict}
Boolean describing behavior on invalid input.
- - -
#### `tf.contrib.distributions.Normal.variance(name='variance')` {#Normal.variance}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册