Tensorflow学习之tf.cast类型转换函数
来源:互联网 发布:阿里云账号注销解绑 编辑:程序博客网 时间:2024/06/16 17:27
tf.cast(x, dtype, name=None) //此函数是类型转换函数,把x的类型转换成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.Raises:TypeError: If x cannot be cast to the dtype.
参数
- x:输入
- dtype:转换目标类型
- name:名称
Tensor
例子
#将0/1转换成bool类型import tensorflow as tfa = tf.Variable([1,0,0,1,1])b = tf.cast(a,dtype=tf.bool)sess = tf.Session()sess.run(tf.initialize_all_variables())print(sess.run(b))#[ True False False True True]
阅读全文
0 0
- Tensorflow学习之tf.cast类型转换函数
- 【Tensorflow】tf.cast 类型转换 函数
- tensorflow学习之路(6):tf.strided_slice()和tf.cast()的认识
- tensorflow学习之常用函数总结:tensorflow.cast()函数
- tensorflow--tf.cast()
- TensorFlow- tf.argmax 函数学习
- [TensorFlow 学习笔记-04]卷积函数之tf.nn.conv2d
- 3. Tensorflow学习笔记之tf.placeholder函数
- MYSQL 类型转换函数 CAST
- ORACLE类型转换函数 CAST
- Mysql-CAST/CONVERT 类型转换函数之 整型
- tensorflow学习之常用函数总结:tensorflow官方例子中的诸如tf.reduce_mean()这类函数
- tensorflow学习之常用函数总结:tensorflow官方例子中的诸如tf.reduce_mean()这类函数
- sql类型转换函数cast和convert
- MySQL 数字类型转换函数(concat/cast)
- sql类型转换函数convert()与cast()
- MySQL类型转换函数cast用法
- MySQL CAST与CONVERT 函数类型转换
- mybatis报错Parameter '**' not found
- Spark性能优化:shuffle调优
- java4.16
- Python小白学习之路
- NOIP模拟(20171031)T1 机器清洁工
- Tensorflow学习之tf.cast类型转换函数
- js中call和apply(函数的上下文调用模式)详解
- PHP下载文件(laravel)
- hadoop安装
- [收藏]redis配置文件详解
- C/C++ 程序编译与链接的过程详解(静态链接)
- 第四课 方法
- Kafka 参数列表和解释
- jdk9新特征系列