【笔记】torch.nn.identity()方法详解:放到最后一层后面显得没有那么空虚,因为前面的层后面都有个激活函数,就最后一层后面啥都没有所以放个Identity占位
eg:print(x[0,0,3:10])x=self.norm(x)print(x[0,0,3:10])tensor([0.0023, 0.0320, 0.7124,-0.0062,-0.5222,-0.6546,-0.1880], grad_fn=)tensor([0.0023, 0.0320, 0.7124,-0.0062,-0.5222,-0.6546,-0.1880], gr