当前位置:网站首页>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)边栏推荐
猜你喜欢

sql两列变为多行过滤显示

科技雲報道:混合辦公的B面:安全與效率如何兼得?

Kingbase export table structure

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

树莓派用VNC Viewer方式远程连接

Why is informatization ≠ digitalization? Finally someone made it clear

leetcode - 295. 数据流的中位数

What is the dry goods microservice architecture? What are the advantages and disadvantages?

自己动手搭建一个简单的网站
![[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (II)](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (II)
随机推荐
Go implements distributed locks
Adelaidet (detectron2) & abcnet environment configuration
树莓派用VNC Viewer方式远程连接
访问数据库时出现错误
How to back up all data on Apple mobile phone in 2 steps (free)
Preliminary construction of SSM project environment
Data collection and management [10]
Cloud native weekly | grafana 9 was officially released; The Chinese version of cloud native vocabulary is now online
Zhai Jia: from technical engineer to open source entrepreneur of "net red"
An annotation elegant implementation of interface data desensitization
【C语言】 详解线程退出函数 pthread_exit
技术:如何设计zkVM电路
MySQL review materials (additional) case when
Source code analysis of go redsync distributed lock
sql数据库存储过程写法
干货丨微服务架构是什么?有哪些优点和不足?
[interview guide] AI algorithm interview
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (III)
人大金仓(KingBase)导出表结构
选对学校,专科也能进华为~早知道就好了