tf.assert_same_float_dtype

tf.assert_same_float_dtype

tf.assert_same_float_dtype

tf.contrib.framework.assert_same_float_dtype

assert_same_float_dtype(
    tensors=None,
    dtype=None
)

Defined in tensorflow/python/ops/check_ops.py.

See the guide: Framework (contrib)

Validate and return float type based on tensors and dtype.

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.

Returns:

Validated 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.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/assert_same_float_dtype

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部