最近在读《代码之髓》,里面讲解了很多编程语言中的concepts是为何产生的。本篇笔记主要参考了书中的第7章:名字与作用域。

转自:米游社@战小医仙

阅读全文 »

This is an automatically translated post by LLM. The original post is in Chinese. If you find any translation errors, please leave a comment to help me improve the translation. Thanks!

Recently, I have been reading "The Essence of Code", which explains the concepts behind many programming languages. This note mainly refers to Chapter 7 of the book: Names and Scopes.

转自:米游社@战小医仙
阅读全文 »

在使用WSL2时,系统有空余内存的情况下,Linux子系统在运行时会不断分配系统内存。随着其不断运行,占据的内存越来越大,甚至会将Windows系统内存占满。因此,在运行WSL时要限制其内存的使用。

阅读全文 »

This is an automatically translated post by LLM. The original post is in Chinese. If you find any translation errors, please leave a comment to help me improve the translation. Thanks!

When using WSL2, the Linux subsystem will continuously allocate system memory while running, as long as there is available memory in the system. As it continues to run, it will occupy more and more memory, and may even fill up the memory of the Windows system. Therefore, it is necessary to limit its memory usage when running WSL.

The operation process is as follows:

  1. Create a .wslconfig configuration file in the user directory.

    • Open the command line.
    • Enter the command notepad .wslconfig to create and edit the configuration file.
  2. Write the WSL configuration:

    1
    2
    3
    4
    [wsl2]
    memory=2GB
    swap=8GB
    localhostForwarding=true

  3. Restart WSL using wsl --shutdown.

关于网络的parameters

Pytorch中,每一个网络继承于nn.Module类,当实例化之后,是通过维护一下8个字典来实现各种网络功能的:

1
2
3
4
5
6
7
8
_parameters
_buffers
_backward_hooks
_forward_hooks
_forward_pre_hooks
_state_dict_hooks
_load_state_dict_pre_hooks
_modules
阅读全文 »

This is an automatically translated post by LLM. The original post is in Chinese. If you find any translation errors, please leave a comment to help me improve the translation. Thanks!

About Network Parameters

In Pytorch, each network inherits from the nn.Module class and implements various network functions by maintaining the following eight dictionaries after instantiation:

1
2
3
4
5
6
7
8
_parameters
_buffers
_backward_hooks
_forward_hooks
_forward_pre_hooks
_state_dict_hooks
_load_state_dict_pre_hooks
_modules
阅读全文 »
0%