import math
import cv2
import torch.nn as nn
import numpy as np
import torch
import torch.nn.functional as F
a = torch.randn(3,4,5)
b = np.random.random(size=(1,5,6))
c = torch.from_numpy(b)
torch.save(c,'/home/UserDirectory/zhegezs/daily_learn/data/c.pt')
d = torch.load('/home/UserDirectory/zhegezs/daily_learn/data/c.pt')
print(d == c )
tensor([[[True, True, True, True, True, True],
[True, True, True, True, True, True],
[True, True, True, True, True, True],
[True, True, True, True, True, True],
[True, True, True, True, True, True]]])
Process finished with exit code 0