小编yi *_* li的帖子

内核虚拟内存空间和进程虚拟内存空间

我正在阅读教科书:Computer Systems A Programmer\xe2\x80\x99s Perspective,第9.7.2章:Linux虚拟内存系统(第三版)中讨论了虚拟内存。

\n\n

我对linux进程的虚拟内存结构有点困惑,如下所示:

\n\n

内存示意图

\n\n

我的问题是:内核虚拟内存是否为内核运行保留,而其余虚拟内存是否为用户进程保留?内核代码和数据的作用是什么?而内核虚拟内存中的物理内存又有何作用呢?

\n

memory virtualization memory-management linux-kernel

3
推荐指数
1
解决办法
2499
查看次数

如何指定pytorch nn.Linear的输入维度?

例如,我定义了一个模型,如下所示:

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)

问题是线性层,我不想计算线性层输入的大小,但定义模型需要指定它。我怎么解决这个问题?

python deep-learning pytorch

1
推荐指数
1
解决办法
4737
查看次数