Module: tfp.experimental.distributions.marginal_fns.ps.tensorshape_util
Stay organized with collections
Save and categorize content based on your preferences.
Utility functions for TensorShape
.
Functions
as_list(...)
: Returns a list
of integers or None
for each dimension.
assert_has_rank(...)
: Raises an exception if x
is not compatible with the given rank
.
assert_is_compatible_with(...)
: Raises exception if x
and other
do not represent the same shape.
concatenate(...)
: Returns the concatenation of the dimension in x
and other
.
constant_value_as_shape(...)
: A version of constant_value()
that returns a TensorShape
.
dims(...)
: Returns a list of dimension sizes, or None
if rank
is unknown.
is_compatible_with(...)
: Returns True
iff x
is compatible with other
.
is_fully_defined(...)
: Returns True iff x
is fully defined in every dimension.
merge_with(...)
: Returns a shape combining the information in x
and other
.
num_elements(...)
: Returns the total number of elements, or None
for incomplete shapes.
rank(...)
: Returns the rank implied by this shape, or None
if it is unspecified.
set_shape(...)
: Updates the shape of this tensor.
with_rank(...)
: Returns a shape based on x
with the given rank
.
with_rank_at_least(...)
: Returns a shape based on x
with at least the given rank
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[],null,["# Module: tfp.experimental.distributions.marginal_fns.ps.tensorshape_util\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/internal/tensorshape_util.py) |\n\nUtility functions for `TensorShape`.\n\nFunctions\n---------\n\n[`as_list(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/as_list): Returns a `list` of integers or `None` for each dimension.\n\n[`assert_has_rank(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/assert_has_rank): Raises an exception if `x` is not compatible with the given `rank`.\n\n[`assert_is_compatible_with(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/assert_is_compatible_with): Raises exception if `x` and `other` do not represent the same shape.\n\n[`concatenate(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/concatenate): Returns the concatenation of the dimension in `x` and `other`.\n\n[`constant_value_as_shape(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/constant_value_as_shape): A version of `constant_value()` that returns a `TensorShape`.\n\n[`dims(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/dims): Returns a list of dimension sizes, or `None` if `rank` is unknown.\n\n[`is_compatible_with(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/is_compatible_with): Returns `True` iff `x` is compatible with `other`.\n\n[`is_fully_defined(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/is_fully_defined): Returns True iff `x` is fully defined in every dimension.\n\n[`merge_with(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/merge_with): Returns a shape combining the information in `x` and `other`.\n\n[`num_elements(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/num_elements): Returns the total number of elements, or `None` for incomplete shapes.\n\n[`rank(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/rank): Returns the rank implied by this shape, or `None` if it is unspecified.\n\n[`set_shape(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/set_shape): Updates the shape of this tensor.\n\n[`with_rank(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/with_rank): Returns a shape based on `x` with the given `rank`.\n\n[`with_rank_at_least(...)`](../../../../../tfp/experimental/distributions/marginal_fns/ps/tensorshape_util/with_rank_at_least): Returns a shape based on `x` with at least the given `rank`."]]