当前位置:网站首页>pytorch 读写文件
pytorch 读写文件
2022-06-29 03:57:00 【薰珞婷紫小亭子】
写文件
torch.save()
import torch
from torch import nn
from torch.nn import functional as F
x= torch.arange(4)
torch.save(x, "x-file") # 程序会自动将x写入到x-file文件中,若开始x-file文件未存在,系统会自动创建该文件名读文件
torch.load()
import torch
from torch import nn
from torch.nn import functional as F
x= torch.arange(4)
torch.save(x, "x-file")
print(x)
x2 = torch.load("x-file") #读取文件
print(x2)边栏推荐
- webassembly学习-动态链接
- Data collection and management [15]
- 欧拉开源社区第二届理事会第二次会议召开,新华三、超聚变和龙芯中科成为理事会成员单位
- leetcode:304. 2D area and retrieval - matrix immutable
- leetcode - 295. 数据流的中位数
- [tcapulusdb knowledge base] Introduction to tcapulusdb data import
- 百度智能云服务网格产品CSM发布 | 火热公测中
- Share 60 divine vs Code plug-ins
- CDC2.2.1还不支持postgresql14.1么?基于pgbouncer连接方式下,以5433
- 科技雲報道:混合辦公的B面:安全與效率如何兼得?
猜你喜欢

88. (cesium chapter) cesium aggregation diagram

Baidu AI Cloud service grid product CSM release 𞓜 hot public beta

High performance current limiter guava ratelimiter

云原生周报 | Grafana 9正式发布;云原生词汇表中文版现已上线

Anaconda自带的Spyder编辑器启动报错问题

Tech Cloud Report: Mixed Office B side: How Safety and Efficiency can be combined?
![[filter design] customize the filter with MATLAB according to the design index](/img/b2/b5576c5eb6dbe9a0c64158802aa1d0.png)
[filter design] customize the filter with MATLAB according to the design index

moudo网络库剖析

Whose encryption key is written in the code? (that's you)

Establishment of small and medium-sized enterprise network
随机推荐
【新功能】Ambire 钱包集成了 Metis 网络
中小型企业网络的组建
Source code analysis of go redsync distributed lock
干货丨微服务架构是什么?有哪些优点和不足?
树莓派用VNC Viewer方式远程连接
SqlServer如何查询除去整列字段为null的结果
【FPGA数学公式】使用FPGA实现常用数学公式
你为什么做测试/开发程序员?还能回想出来吗......
【布里渊现象】光纤布里渊温度和应变分布同时测量系统研究
Set hardware breakpoint instruction for ejtag under the PMON of the Godson development board
Data statistical analysis (SPSS) [6]
谁家的加密密钥,写死在代码里?(说的就是你)
leetcode - 295. 数据流的中位数
大神们 在富函数的open中从mysql连接池里取连接 连接池初始化是20个 如果富函数的并行度是1
New listing of operation light 3.0 -- a sincere work of self subversion across the times
High performance current limiter guava ratelimiter
88. (cesium chapter) cesium aggregation diagram
Share 60 divine vs Code plug-ins
Do you feel confused when you study at three in the morning?
MySQL复习资料(附加)case when