当前位置:网站首页>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))
边栏推荐
- 博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
- MySQL 版本升级心得
- 技能在赛题解析:交换机防环路设置
- Unity3D 学习路线?
- daily sql - query for managers and elections with at least 5 subordinates
- 你是如何做好Unity项目性能优化的
- LeetCode刷题系列 -- 46. 全排列
- 【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
- 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?
- 2021-08-11 for循环结合多线程异步查询并收集结果
猜你喜欢
prometheus学习5altermanager
Redis测试
【Pytorch】nn.Linear,nn.Conv
【LeetCode每日一题】——682.棒球比赛
详述MIMIC 的ICU患者检测时间信息表(十六)
Spatial Pyramid Pooling -Spatial Pyramid Pooling (including source code)
基于FPGA的FIR滤波器的实现(5)— 并行结构FIR滤波器的FPGA代码实现
radix-4 FFT principle and C language code implementation
jar服务导致cpu飙升问题-带解决方法
【Pytorch】nn.PixelShuffle
随机推荐
李沐d2l(十)--卷积层Ⅰ
Unity开发者必备的C#脚本技巧
Internet phone software or consolidation of attack must be "free" calls security clearance
EasyPlayer针对H.265视频不自动播放设置下,loading状态无法消失的解决办法
Pytorch模型转ONNX模型
sql--Users who have purchased more than 3 times (inclusive) within 7 days (including the current day), and the purchase amount in the past 7 days exceeds 1,000
Shell:三剑客之awk
Cobbleland 博览会 基础系列 1
微信小程序功能上新(2022.06.01~2022.08.04)
Service的两种启动方式与区别
结合均线分析k线图的基本知识
js判断图片是否存在
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
DDR4内存条电路设计
daily sql - user retention rate for two days
网络电话软件或迎整顿 “免费”通话须迈安全关
Daily sql: request for friend application pass rate
JD.com product details API call example explanation
ROS 话题通信理论模型
深度监督(中继监督)