摘要: 本文简单介绍 torch.nn.Module.register_forward_hook钩子函数的使用,简单写了一个卷积的网络,在net.conv1.register_forward_hook注册钩子函数,则会有module、输入input数据与卷积后输出数据output,重点说明module是关于 阅读全文
posted @ 2023-06-13 16:44 tangjunjun 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 本文简单介绍 torch.nn.Module.register_forward_pre_hook钩子函数的使用,简单写了一个卷积的网络,在net.conv1.register_forward_pre_hook注册钩子函数,函数参数为module与输入input数据,在self.conv1层注册,模型 阅读全文
posted @ 2023-06-13 15:55 tangjunjun 阅读(226) 评论(0) 推荐(0) 编辑
https://rpc.cnblogs.com/metaweblog/tangjunjun