当前位置:网站首页>tf.cast(), reduce_min(), reduce_max()
tf.cast(), reduce_min(), reduce_max()
2022-08-11 07:47:00 【phac123】
Article table of contents
Introduction
In tensorflow, you can use tf.cast() to convert the type of tensor variables. Use tf.reduce_min and tf.reduce_max to calculate the maximum and minimum values of elements on the tensor.
implemented
import tensorflow as tfx1 = tf.constant([1., 2., 3.], dtype = tf.float64)print("x1: ", x1)x2 = tf.cast(x1, tf.int32)print("x2: ", x2)print("minimum of x2: ", tf.reduce_min(x2))print("maxmum of x2: ", tf.reduce_max(x2))
边栏推荐
- 1071 小赌怡情 (15 分)
- TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
- jar服务导致cpu飙升问题-带解决方法
- 软件测试主要做什么工作,难不难?
- 1101 B是A的多少倍 (15 分)
- golang fork 进程的三种方式
- 基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
- Daily sql-statistics of the number of professionals (including the number of professionals is 0)
- 2022年中国软饮料市场洞察
- Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
猜你喜欢
随机推荐
1101 B是A的多少倍 (15 分)
How Unity handles C# under the hood
radix-4 FFT principle and C language code implementation
prometheus学习5altermanager
C语言每日一练——Day02:求最小公倍数(3种方法)
TF中使用softmax函数;
ROS 服务通信理论模型
oracle19c不支持实时同步参数,请教一下大佬们有什么好的解决办法吗?
How to choose professional, safe and high-performance remote control software
TF中的One-hot
恒源云-Pycharm远程训练避坑指南
Tidb二进制集群搭建
下一代 无线局域网--强健性
李沐d2l(十)--卷积层Ⅰ
Pytorch模型转ONNX模型
1061 判断题 (15 分)
1106 2019数列 (15 分)
unable to extend table xxx by 1024 in tablespace xxxx
TF中的条件语句;where()
详述 MIMIC护理人员信息表(十五)