xiaocj
xiaocj
头文件中的宏定义
**宏定义的好处之一**:宏定义的使用可以增加预编译指令,防止多次包含同一头文件时出现编译错误。 ```c++ // func.h int ADD(int a, int b); //以下为增加宏定义的写法 #ifndef FUNC_H #define FUNC_H int ADD(int a, int b); #endif ``` **结论**:在头文件中使用宏定义,可以使得头文件在**一个源文件**中被多次include时,同一段代码只被编译一次。一个头文件在不同的源文件中,依旧会被编译多次。因此若在头文件中定义函数或变量,即使头文件中使用了宏定义,头文件中的代码在多个源文件中依旧会被编译多次,导致链接时出错。 我们从下面的样例中进行分析: ##### func1.h ```c++ int add(int x, int...
Could you please release the checkpoints of the pre-trained models?
Existing `TransformerBlockList` cannot output the hidden states and attention scores for each transformer layer. Sometimes we want to get the hiddens and attention scores to conduct analysis and feed them...
I want to run some experiements based on the pre-trained domain models. Could you release the checkpoints pre-trained with domain adapters? Thanks a lot!