当前位置:网站首页>Use zeros(), ones(), fill() methods to generate data in TF
Use zeros(), ones(), fill() methods to generate data in TF
2022-08-09 23:11:00 【phac123】
Brief
zeros() in tf can generate a tensor with a value of 0 in a specified shape.
ones() in tf can generate a tensor with a value of 1 in a specified shape.
fill() in tf canGenerates a tensor of the specified value of the specified shape.
Code
import tensorflow as tfa = tf.zeros([2, 3])b = tf.ones([2, 3])c = tf.fill([2, 3], 9)a = tf.zeros((2, 3))b = tf.ones([2, 3])c = tf.fill([2, 3], 9)print("a: ", a)print("b: ", b)print("c: ", c)
边栏推荐
- mysql多表左链接查询
- 论文解读(DropEdge)《DropEdge: Towards Deep Graph Convolutional Networks on Node Classification》
- STC8H Development (15): GPIO Drives Ci24R1 Wireless Module
- Reinforcement Learning Weekly Issue 57: DL-DRL, FedDRL & Deep VULMAN
- 技术分享 | 接口自动化测试之JSON Schema模式该如何使用?
- 普源精电上半年扭亏为盈,高端产品持续发力!你看好仪器界“华为”吗?
- LeetCode26:删除有序数组中的重复项
- 【stack】【queue】【priority_queue】【deque】Detailed explanation
- Tensorflow中placeholder函数的用法
- Cholesterol-PEG-Thiol, CLS-PEG-SH, Cholesterol-PEG-Sulfhydryl for improved solubility
猜你喜欢
别叫我玩,我要考PMP:考PMP选择机构需要了解的那些事儿
CVPR22 Oral|通过多尺度token聚合分流自注意力,代码已开源
角度和弧度的相互换算
Definition and Basic Operations of Linear Tables
LoRa Basics无线通信技术和应用案例详解
几种绘制时间线图的方法
AI Knows Everything: Building and Deploying a Sign Language Recognition System from Zero
DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine reduce the immunogenicity of peptides
Byte side: Can TCP and UDP use the same port?
编程时请选择正确的输入法,严格区分中英文
随机推荐
什么是源文件?
Problems with compiling SIP with QGIS
什么是IDE(集成开发环境)?
What to do if Windows 11 can't find Internet Explorer
Byte side: Can TCP and UDP use the same port?
浅谈Numpy中的shape、reshape函数的区别
SQL语句及索引的优化
哪款C语言编译器(IDE)适合初学者?
supervisor 命令操作大全「建议收藏」
Application of Acrel5000web Energy Consumption System in a College-Susie Week
AI+医疗:使用神经网络进行医学影像识别分析
TF中random.normal()与random.truncated_normal()
微软word怎么转换成pdf文件?微软word转换为pdf格式的方法
Word文档怎么输入无穷大符号∞
LeetCode Daily Question (321. Create Maximum Number)
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
CVPR22 Oral|通过多尺度token聚合分流自注意力,代码已开源
Wps下划线怎么弄?Wps添加下划线的最全方法
角度和弧度的相互换算
人人都可以DIY的大玩具,宏光MINIEV GAMEBOY产品力强,出行新装备