tf.cast (API r1.3)
2017-11-18 20:35
411 查看
tf.cast (API r1.3)
1. tf.castcast( x, dtype, name=None )
Defined in tensorflow/python/ops/math_ops.py.
See the guide: Tensor Transformations > Casting
Casts a tensor to a new type.
The operation casts x (in case of Tensor) or x.values (in case of SparseTensor) to dtype.
For example:
# tensor `a` is [1.8, 2.2], dtype=tf.float tf.cast(a, tf.int32) ==> [1, 2] # dtype=tf.int32
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.
2. example 1
output:
相关文章推荐
- tf.concat (API r1.3)
- tf.matmul (API r1.3)
- tf.argmax (API r1.3)
- tf.reshape (API r1.3)
- tf.reduce_sum (API r1.3)
- tensorflow_api_1:tf.cast( )
- tf.split (API r1.3)
- java.lang.ClassCastException: android.app.Application cannot be cast to serialport_api.sample.App问题
- Tensorflow高级API的进阶--利用tf.contrib.learn建立输入函数
- jQuery1.3 API 中文版
- JSR 206: Java API for XML Processing (JAXP) 1.3
- UE4蓝图API翻译【节点】--- Cast To Actor
- Tensorflow(r1.4)API--tf.nn.max_pool
- cannot be cast to javax.servlet.Filter 报错, 原因servlet-api.jar冲突
- jQuery 1.3 API 参考文档中文版
- 百度地图离线化(API v=1.3)
- tensorflow API:tf.split
- tensorflow API: tf.unsorted_segment_sum
- 利用TF_Object_detection_API 训练自己的模型
- Tensorflow(r1.4)API--tf.summary.scalar