tfp.experimental.distributions.marginal_fns.ps.dtype_util.assert_same_float_dtype
Validate and return float type based on tensors
and dtype
.
tfp.experimental.distributions.marginal_fns.ps.dtype_util.assert_same_float_dtype(
tensors=None, dtype=None
)
For ops such as matrix multiplication, inputs and weights must be of the
same float type. This function validates that all tensors
are the same type,
validates that type is dtype
(if supplied), and returns the type. Type must
be a floating point type. If neither tensors
nor dtype
is supplied,
the function will return dtypes.float32
.
Args |
tensors
|
Tensors of input values. Can include None elements, which will
be ignored.
|
dtype
|
Expected type.
|
Raises |
ValueError
|
if neither tensors nor dtype is supplied, or result is not
float, or the common type of the inputs is not a floating point type.
|
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.
[null,null,["Last updated 2023-11-21 UTC."],[],[]]