当前位置:网站首页>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))

边栏推荐
- 2022-08-10 第四小组 修身课 学习笔记(every day)
- Depth (relay supervision)
- How to choose professional, safe and high-performance remote control software
- STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比
- 博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
- 公牛10-11德里克·罗斯最强赛季记录
- Taobao sku API interface (PHP example)
- Service的两种启动方式与区别
- 【推荐系统】:协同过滤和基于内容过滤概述
- Spatial Pyramid Pooling -Spatial Pyramid Pooling (including source code)
猜你喜欢
随机推荐
Production and optimization of Unity game leaderboards
ROS 话题通信理论模型
EasyPlayer针对H.265视频不自动播放设置下,loading状态无法消失的解决办法
Taobao API common interface and acquisition method
【Pytorch】nn.PixelShuffle
Pico neo3在Unity中的交互操作
MindManager2022全新正式免费思维导图更新
为什么我使用C#操作MySQL进行中文查询失败
exness:黄金1800关口遇阻,静待美国CPI出炉
【软件测试】(北京)字节跳动科技有限公司二面笔试题
Depth (relay supervision)
Unity开发者必备的C#脚本技巧
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
Douyin API interface
关于Android Service服务的面试题
linux 安装mysql服务报错
JVM学习——3——数据一致性
Waldom Electronics宣布成立顾问委员会
Daily sql-statistics of the number of professionals (including the number of professionals is 0)









