tensorflow 中对数组元素的操作方法
作者:matdodo 时间:2022-01-22 11:35:37
tensorflow中对tensor对象进行像numpy数组一样便捷的操作是不可能的, 至少对1.2以及之前的版本而言。
从issue上看到,有不少人希望tensorflow能及早实现这些操作,但近期来看是不太可能了。
但是,这样的操作的确可以实现。
下面我来向大家介绍几种常用的操作,以及其在tensorflow中的实现方式。
我的代码仅仅是抛砖引玉吧。
谁有更好的方法就放在评论中分享给大家吧。
预先给那个人点个赞。
1、在tensor对象中提取某一行。
2、将tensor中的某一行进行赋值。
来源:https://blog.csdn.net/myjiayan/article/details/74602145
标签:tensorflow,数组,元素
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python简单鼠标自动点击某区域的实例
2021-03-05 16:35:52
Python+matplotlib实现简单曲线的绘制
2023-01-05 17:21:27
![](https://img.aspxhome.com/file/2023/2/78492_0s.png)
编写SQL需要注意的细节Checklist总结
2012-10-07 10:43:57
解决pytorch-yolov3 train 报错的问题
2023-11-26 04:14:29
![](https://img.aspxhome.com/file/2023/2/69632_0s.jpg)
如何从Python的cmd中获得.py文件参数
2022-04-15 17:50:31
![](https://img.aspxhome.com/file/2023/3/131273_0s.png)
python 如何在list中找Topk的数值和索引
2022-01-20 10:28:27
Python使用Pygame绘制时钟
2022-08-04 14:10:07
![](https://img.aspxhome.com/file/2023/5/105625_0s.jpg)
ASP表单验证方法总结
2007-10-06 22:43:00
python中break、continue 、exit() 、pass终止循环的区别详解
2023-03-08 15:59:52
![](https://img.aspxhome.com/file/2023/8/118728_0s.jpg)
python中enumerate() 与zip()函数的使用比较实例分析
2021-02-27 15:00:26
Python + selenium自动化环境搭建的完整步骤
2023-11-19 12:42:57
![](https://img.aspxhome.com/file/2023/7/65987_0s.png)
Python列表list的详细用法介绍
2021-04-17 06:56:15
![](https://img.aspxhome.com/file/2023/3/95163_0s.png)
使用Python爬虫爬取小红书完完整整的全过程
2022-03-23 05:12:44
![](https://img.aspxhome.com/file/2023/4/114534_0s.png)
python绘制随机网络图形示例
2023-10-03 11:21:38
![](https://img.aspxhome.com/file/2023/3/115603_0s.jpg)
wxpython布局的实现方法
2022-01-31 10:20:57
![](https://img.aspxhome.com/file/2023/0/131110_0s.png)
python中日期和时间格式化输出的方法小结
2023-07-01 11:39:31
php根据isbn书号查询amazon网站上的图书信息的示例
2023-11-15 03:08:53
Python中将字典转换为XML以及相关的命名空间解析
2022-07-22 20:05:03
Python中交换两个元素的实现方法
2023-07-29 08:28:15
python 函数内部修改外部变量的方法
2022-05-24 09:04:19