DL模型解析
天才da熊猫
这个作者很懒,什么都没留下…
展开
-
关于pytorch的upsample_bilinear2d的align_corners和half_pixel等参数确定
代码位置在:aten/src/Aten/native/cpu/UpSampleMoreKernel.cpp,关于bilinear的坐标计算过程:template <typename scalar_t>static inline scalar_t area_pixel_compute_source_index( scalar_t scale, int64_t dst_index, bool align_corners, bool cubic) { if.原创 2020-12-01 15:06:02 · 1708 阅读 · 0 评论 -
pytorch的模型解析
如何获取pytorch的动态图?model = torch.jit.load("test.pth")graph = model.graph.copy()torch._C._jit_pass_inline(graph)node_list = graph.nodes()加载模型后,获取模型的graph,这个graph就是需要的动态图。graph node就是计算图的计算节点(有序),关于各个层的相关参数都可以从node节点中获取,各个参数的相对位置需要查找一下该op的实现。需要注意的是,需要原创 2020-11-13 11:10:42 · 2113 阅读 · 5 评论