当前位置:网站首页>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)边栏推荐
- 二叉树序列化与反序列化(leetcode(困难))
- Four distributed session solutions
- [World Ocean Day] tcapulusdb calls on you to protect marine biodiversity together
- mysql动态加表只能加小表,加大表跑着跑着任务就不读数据了,有什么解决办法吗
- 5-minute NLP: summary of time chronology from bag of words to transformer
- 要不是和阿里P7聊过,我也不知道自己是个棒槌
- Live broadcast preview | neurips special session I & Young Scientists special session
- 科班出身,结果外包都不要
- 科技云报道:混合办公的B面:安全与效率如何兼得?
- [Brillouin phenomenon] Study on simultaneous measurement system of Brillouin temperature and strain distribution in optical fiber
猜你喜欢
![[tcapulusdb knowledge base] modify business modify cluster](/img/a6/e8067809c8a5d8a222b0ad0d545591.png)
[tcapulusdb knowledge base] modify business modify cluster

Technology cloud report: side B of mixed office: how to have both security and efficiency?

Seura 2 test code summary

【新功能】Ambire 钱包集成了 Metis 网络

87. (cesium chapter) cesium thermal map (pasted with terrain)

Go implements distributed locks

选对学校,专科也能进华为~早知道就好了

Share 60 divine vs Code plug-ins
![[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (III)](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (III)

How to keep database and cache consistent
随机推荐
【C语言】开启一个线程
干货丨微服务架构是什么?有哪些优点和不足?
87. (cesium chapter) cesium thermal map (pasted with terrain)
你为什么做测试/开发程序员?还能回想出来吗......
Baidu AI Cloud service grid product CSM release 𞓜 hot public beta
SqlServer如何查询除去整列字段为null的结果
The efficiency of 20 idea divine plug-ins has been increased by 30 times, and it is necessary to write code
[data update] NPU development data based on 3568 development board is fully upgraded
要不是和阿里P7聊过,我也不知道自己是个棒槌
智能视觉组比赛流程草案
Microsecond TCP timestamp
[fpga+sin] FPGA implementation of sinusoidal signal generator module based on DDS (direct digital synthesis)
[tcapulusdb knowledge base] tcapulusdb technical support introduction
Data statistical analysis (SPSS) [7]
Binary tree serialization and deserialization (leetcode (difficult))
Data collection and management [5]
Seura 2测试代码总结
NotImplementedError: Could not run torchvision::nms
泠静的想一想自己的路
Draft competition process of Intelligent Vision Group