当前位置:网站首页>tf.cast(),reduce_min(),reduce_max()
tf.cast(),reduce_min(),reduce_max()
2022-08-11 06:45:00 【phac123】
简介
在tensorflow中可以使用tf.cast()对tensor变量的类型进行转换.使用tf.reduce_min和tf.reduce_max可以计算张量上元素的最大值和最小值.
实现
import tensorflow as tf
x1 = 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))
边栏推荐
- Daily sql-seek the sum of successful investments in 2016
- Multiscale communication in cortical-cortical networks
- mysql视图与索引
- JD.com product details API call example explanation
- 【预约观看】Ambire 智能钱包 AMA 活动第四期即将举行
- 一种用于EEG超扫描研究的分析流程
- 【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
- 国密规范 SM2 SM3 SM4
- Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
- DDR4内存条电路设计
猜你喜欢
Pinduoduo api interface application example
easyrecovery15数据恢复软件收费吗?功能强大吗?
基于FPGA的FIR滤波器的实现(5)— 并行结构FIR滤波器的FPGA代码实现
Multiscale communication in cortical-cortical networks
Strongly recommend an easy-to-use API interface
3GPP LTE/NR信道模型
Douyin API interface
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
Discourse 的关闭主题(Close Topic )和重新开放主题
A used in the study of EEG ultra scanning analysis process
随机推荐
梅科尔工作室——BP神经网络
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
【软件测试】(北京)字节跳动科技有限公司二面笔试题
Edge 提供了标签分组功能
详述 MIMIC护理人员信息表(十五)
【深度学习】什么是互信息最大化?
Redis测试
ssh服务攻防与加固
Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
What are the things that should be planned from the beginning when developing a project with Unity?How to avoid a huge pit in the later stage?
从何跟踪伦敦金最新行情走势?
联想集团:2022/23财年第一季度业绩
Pico neo3 Unity打包设置
DDR4内存条电路设计
详述MIMIC 的ICU患者检测时间信息表(十六)
技能在赛题解析:交换机防环路设置
Unity3D 学习路线?
concept noun
Waldom Electronics宣布成立顾问委员会