当前位置:网站首页>TF使用constant生成数据
TF使用constant生成数据
2022-08-09 21:35:00 【phac123】
简介
TF指定了生成的数据类型,最后生成的数据就是指定的类型;如果TF中使用constant没有指定生成什么数据,如果是1,4这样的整数,那么默认的数据类型为 tf.int32.
实现与分析
One
import tensorflow as tf
a = tf.constant([1, 5], dtype = tf.int64)
print("a: ", a)
print("a.dtype: ", a.dtype)
print("a.shape: ", a.shape)
Two:默认
import tensorflow as tf
a = tf.constant([1, 5])
print("a: ", a)
print("a.dtype: ", a.dtype)
print("a.shape: ", a.shape)
three
import tensorflow as tf
a = tf.constant([1, 5], dtype = tf.float32)
print("a: ", a)
print("a.dtype: ", a.dtype)
print("a.shape: ", a.shape)
边栏推荐
- Reverse Analysis of Unknown Cryptographic Protocol Based on Network Data Flow
- LED闪烁 闪灯芯片IC 手电筒IC 闪灯控制IC 闪烁IC流水灯
- [Deep learning] pix2pix GAN theory and code implementation
- Problems with compiling SIP with QGIS
- Don't use array.length-1 to get the last item of the array
- LeetCode Daily Question (321. Create Maximum Number)
- 基于网络数据流的未知密码协议逆向分析
- Next second data: the transformation of the modern data stack brought about by the integration of lake and warehouse has begun
- XXE-XML外部实体注入-知识点
- How to fix Windows 11 not finding files
猜你喜欢
数据集成API如何成为企业数字化转型的关键?
普源精电上半年扭亏为盈,高端产品持续发力!你看好仪器界“华为”吗?
[Deep learning] pix2pix GAN theory and code implementation
一千以内的水仙花数
FS4066耐高压1到4节内置MOS的锂电池充电管理芯片
poj 3070 Fibonacci(简单矩阵连乘)
[Generic Programming] Full Detailed Explanation of Templates
安科瑞支持以太网通讯、profibus通讯嵌入式电能表APM指导性技术要求-Susie 周
Optimization of SQL Statements and Indexes
小黑leetcode清爽雨天之旅,刚吃完宇飞牛肉面、麻辣烫和啤酒:112. 路径总和
随机推荐
Optimization of SQL Statements and Indexes
Jensen (琴生) 不等式
消防安全培训|“蓝朋友”,开课了!
Reverse Analysis of Unknown Cryptographic Protocol Based on Network Data Flow
Visual studio 2022 debugging skills introduction
字节二面问的MySQL,差点没答好
Daily practice of PMP | Do not get lost in the exam -8.8 (including agility + multiple choice)
C语言中的文件是什么?
Jmeter 使用正则表达式提取器将返回值全部保存到一个文件中
PHP 二维数组根据某个字段排序
Byte side: Can TCP and UDP use the same port?
Don't use array.length-1 to get the last item of the array
mysql多表左链接查询
Don't tell me to play, I'm taking the PMP exam: what you need to know about choosing an institution for the PMP exam
What to do if Windows 11 can't find Internet Explorer
PMP每日一练 | 考试不迷路-8.8(包含敏捷+多选)
How are data integration APIs key to enterprise digital transformation?
cad图纸怎么复制到word文档里面?Word里插CAD图怎么弄?
Characteristics and Development Prospects of Korea's Cyber Security System
【stack】【queue】【priority_queue】【deque】详解