当前位置:网站首页>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)
边栏推荐
- 筑牢安全防线 鹤壁经济技术开发区开展安全生产培训
- mysql多表左链接查询
- 字节二面问的MySQL,差点没答好
- SecureCRT背景配色
- Characteristics and Development Prospects of Korea's Cyber Security System
- PMP每日一练 | 考试不迷路-8.8(包含敏捷+多选)
- [Generic Programming] Full Detailed Explanation of Templates
- LED闪烁 闪灯芯片IC 手电筒IC 闪灯控制IC 闪烁IC流水灯
- 【泛型编程】模板全详解
- URL Protocol web page to open the application
猜你喜欢
POWER SOURCE ETA埃塔电源维修FHG24SX-U概述
Word第一页不要页眉怎么设置?设置Word首页不要页眉方法教程
URL Protocol web page to open the application
XXE-XML外部实体注入-知识点
knn到底咋回事?
Byte side: Can TCP and UDP use the same port?
痛击面试官 CURD系统也能做出技术含量
Don't use array.length-1 to get the last item of the array
cadence中复制一部分PCB到另一个PCB中去
蓝牙模块有哪些种类?BLE低功耗蓝牙模块有什么特点?
随机推荐
Optimization of SQL Statements and Indexes
数据集成API如何成为企业数字化转型的关键?
Can I make a TCP connection without accept?
URL Protocol 网页打开应用程序
安科瑞支持以太网通讯、profibus通讯嵌入式电能表APM指导性技术要求-Susie 周
PMP每日一练 | 考试不迷路-8.9(包含敏捷+多选)
hdu 1333 Smith Numbers(暴力思路)
【深度学习】pix2pix GAN理论及代码实现
Access Characteristics of Constructor under Inheritance Relationship
Definition and Basic Operations of Sequence Tables
Number of daffodils within a thousand
Acrel5000web能耗系统在某学院的应用-Susie 周
An overall security understanding and method of cyberspace based on connection and security entropy
Word箭头上面怎么打字
leetcode:数组中的第K个最大元素
韩国网络安全体系特征与发展前景
DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine reduce the immunogenicity of peptides
蓝牙模块的分类和对应的属性特点
AI+医疗:使用神经网络进行医学影像识别分析
字符串哈希(2014 SERC J题)