tensorflow.cast参数及功能

  • Post author:
  • Post category:其他


cast(x, dtype, name=None)

功能是将一个张量的元素类型转换成目标dtype类型

Args:

x: A

Tensor

or

SparseTensor

.

dtype: The destination type.

name: A name for the operation (optional).

Returns:

A

Tensor

or

SparseTensor

with same shape as

x

.

参数:

x: 一个张量

dtype:目标类型

name:该操作名

返回一个张量,尺寸与输入x张量一致



版权声明:本文为weixin_37725502原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。