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

边栏推荐
- 【Pytorch】nn.ReLU(inplace=True)
- Strongly recommend an easy-to-use API interface
- 2022-08-09 Group 4 Self-cultivation class study notes (every day)
- 囍楽云任务源码
- Taobao API interface reference
- When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
- How do you optimize the performance of your Unity project?
- 从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
- Redis + lua implements distributed interface current limiting implementation scheme
- NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
猜你喜欢

unable to extend table xxx by 1024 in tablespace xxxx

囍楽云任务源码

Amazon Get AMAZON Product Details API Return Value Description

每日sql--统计员工近三个月的总薪水(不包括最新一个月)

Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景

Tidb二进制集群搭建

一张图了解JVM八大原子操作

【Pytorch】nn.Linear,nn.Conv

Douyin get douyin share password url API return value description

Taobao API interface reference
随机推荐
Shell:三剑客之awk
【LeetCode每日一题】——682.棒球比赛
联想集团:2022/23财年第一季度业绩
ROS 服务通信理论模型
Discourse 的关闭主题(Close Topic )和重新开放主题
【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
皮质-皮质网络的多尺度交流
daily sql - user retention rate for two days
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
unable to extend table xxx by 1024 in tablespace xxxx
【Pytorch】nn.PixelShuffle
radix-4 FFT principle and C language code implementation
李沐d2l(十)--卷积层Ⅰ
【LeetCode每日一题】——844.比较含退格的字符串
接口测试的基础流程和用例设计方法你知道吗?
【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
Do not add the is prefix to the variables of the boolean type in the POJO class of the Alibaba specification
Trill keyword search goods - API
Douyin API interface