PyTorch to Paddle 计算图转换 #640
WHoutstanding
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PyTorch to Paddle 计算图转换
1. 背景与目标
1.1 背景
GraphNet 项目包含大量从 PyTorch 提取的计算图样本(位于
samples/目录),需要将这些样本转换为 PaddlePaddle 格式,以扩展 Paddle 样本库并支持跨框架对比分析。1.2 目标
samples/中的 PyTorch 样本批量转换为 Paddle 格式torch_to_paddle_samples/目录2. 样本结构分析
2.1 PyTorch 样本文件结构
每个 PyTorch 样本目录包含以下文件:
2.2 文件转换方法
2.2.1 model.py
example:
torch.nn.functional.max_pool2d
torch._C._nn.linear
s1: torch.SymInt
2.2.2 weight_meta.py
"torch.float32"→"paddle.float32","torch.int64"→"paddle.int64"2.2.3 graph_net.json
"framework": "torch"→"framework": "paddle"2.2.4 input_meta.py
2.2.5 graph_hash.txt
graph_net.paddle.validate的--no-dump-graph-hash-key选项)PyTorch to Paddle 计算图转换当前重点问题
如何解决model.py 部分api无法成功转换
Beta Was this translation helpful? Give feedback.
All reactions