torch.nn.ReLU官网:https://pytorch.org/docs/stable/generated/torch.nn.ReLU.html#relu
TORCH.NN.FUNCTIONAL.RELU官网:https://pytorch.org/docs/stable/generated/torch.nn.functional.relu.html
torch.nn.ReLU
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/b60637a5590245c497a3a0ac3528aa6e.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/1718c9ce8c814ceabf7111c9d365de32.png)
TORCH.NN.FUNCTIONAL.RELU
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/ee76fc225c7e42f1aed5e85e9c43bcc3.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/636cf4e4f93948eb89cab9cf94011d89.png)
总结
第一种,需要定义一个实例然后再使用。
第二种,可以直接使用。