当前位置:网站首页>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)
边栏推荐
猜你喜欢
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified silica particles
Wps下划线怎么弄?Wps添加下划线的最全方法
蓝牙模块的分类和对应的属性特点
windos安装Mysql8.0,及解决重新登录异常问题 ERROR 1045 (28000)
消防安全培训|“蓝朋友”,开课了!
Don't use array.length-1 to get the last item of the array
Application of Acrel5000web Energy Consumption System in a College-Susie Week
UE4_定序器控制蓝图对象
别叫我玩,我要考PMP:考PMP选择机构需要了解的那些事儿
SQLi-LABS Page-2 (Adv Injections)
随机推荐
场效应管Mosfet之雷卯Leiditech对应英飞凌Infineon
Visual studio 2022 debugging skills introduction
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified silica particles
np中的round函数,ceil函数与floor函数
技术分享 | 接口自动化测试之JSON Schema模式该如何使用?
【Efficient Tools】Remote Control Software ToDesk (Favorites)
Unity_平滑移动
POWER SOURCE ETA埃塔电源维修FHG24SX-U概述
cadence中复制一部分PCB到另一个PCB中去
Photometric Stereo 光度立体法三维重建
【云原生】4.2 DevOps 精讲篇
Characteristics and Development Prospects of Korea's Cyber Security System
NetCore路由的Endpoint模式
PMP每日一练 | 考试不迷路-8.8(包含敏捷+多选)
蓝牙模块有哪些种类?BLE低功耗蓝牙模块有什么特点?
C语言中的文件是什么?
Unity2D_背景粒子效果
Referenced file contains errors 完美解决方法
抽象类 or 接口
UE4_定序器控制蓝图对象