摘要:
import torch import torch.nn as nn X = torch.rand((6, 8)) Y = torch.rand((6, 7)) # (批量⼤⼩、通道、⾼度、宽度) X = X.reshape((1, 1, 6, 8)) Y = Y.reshape((1, 1, 6, 阅读全文
posted @ 2024-08-25 18:00
不是孩子了
阅读(16)
评论(0)
推荐(0)
摘要:
model.eval()和torch.no_grad()的区别 https://blog.csdn.net/qq_41813454/article/details/135129279 import torch import torch.nn as nn import torch.nn.functio 阅读全文
posted @ 2024-08-25 12:08
不是孩子了
阅读(13)
评论(0)
推荐(0)
摘要:
1、nn.Parameter函数 2、torch.mm 和torch.matmul区别 都是 PyTorch 中用于矩阵乘法的函数,但它们在使用上有细微的差别 import torch import torch.nn as nn import torch.nn.functional as F cla 阅读全文
posted @ 2024-08-25 11:41
不是孩子了
阅读(30)
评论(0)
推荐(0)
摘要:
使用torch.nn.LazyLinear(output)实现延迟初始化 import torch import torch.nn as nn class MyModel(nn.Module): def __init__(self): super(MyModel, self).__init__() 阅读全文
posted @ 2024-08-25 11:18
不是孩子了
阅读(70)
评论(0)
推荐(0)
摘要:
 阅读全文
posted @ 2024-08-25 11:04
不是孩子了
阅读(10)
评论(0)
推荐(0)
摘要:
  
评论(0)
推荐(0)
摘要:
torch.rand和torch.randn的区别: 阅读全文
posted @ 2024-08-25 10:49
不是孩子了
阅读(10)
评论(0)
推荐(0)

浙公网安备 33010602011771号