我正在阅读教科书:Computer Systems A Programmer\xe2\x80\x99s Perspective,第9.7.2章:Linux虚拟内存系统(第三版)中讨论了虚拟内存。
\n\n我对linux进程的虚拟内存结构有点困惑,如下所示:
\n\n\n\n我的问题是:内核虚拟内存是否为内核运行保留,而其余虚拟内存是否为用户进程保留?内核代码和数据的作用是什么?而内核虚拟内存中的物理内存又有何作用呢?
\n例如,我定义了一个模型,如下所示:
class Net(nn.module):
def __init__():
self.conv11 = nn.Conv2d(in_channel,out1_channel,3)
self.conv12 = nn.Conv2d(...)
self.conv13 = nn.Conv2d(...)
self.conv14 = nn.Conv2d(...)
...
#Here is the point
flat = nn.Flatten()
#I don't want to compute the size of data after flatten, but I need a linear layer.
fc_out = nn.Linear(???,out_dim)
Run Code Online (Sandbox Code Playgroud)
问题是线性层,我不想计算线性层输入的大小,但定义模型需要指定它。我怎么解决这个问题?