tensorflow.cast参数及功能

来源:互联网 发布:开票软件默认密码 编辑:程序博客网 时间:2024/06/05 01:03

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张量一致

原创粉丝点击