Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
07929a13
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
大约 1 年 前同步成功
通知
328
Star
698
Fork
167
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
26
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
X2Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
26
Issue
26
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
07929a13
编写于
6月 06, 2022
作者:
W
wjj19950828
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean fluid
上级
6bbecdc4
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
10 addition
and
20 deletion
+10
-20
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/detectionoutput.py
...mapper/caffe2paddle/caffe_custom_layer/detectionoutput.py
+1
-1
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py
...le/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py
+1
-2
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/select.py
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/select.py
+0
-1
x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py
x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py
+1
-1
x2paddle/op_mapper/prim2code.py
x2paddle/op_mapper/prim2code.py
+1
-1
x2paddle/op_mapper/pytorch2paddle/aten.py
x2paddle/op_mapper/pytorch2paddle/aten.py
+2
-2
x2paddle/op_mapper/pytorch2paddle/pytorch_custom_layer/instance_norm.py
...pper/pytorch2paddle/pytorch_custom_layer/instance_norm.py
+1
-1
x2paddle/optimizer/fusion/interpolate_bilinear_fuser.py
x2paddle/optimizer/fusion/interpolate_bilinear_fuser.py
+2
-2
x2paddle/utils.py
x2paddle/utils.py
+1
-9
未找到文件。
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/detectionoutput.py
浏览文件 @
07929a13
...
...
@@ -34,7 +34,7 @@ class DetectionOutput(object):
pbv
=
priorbox_list
[
1
]
pb
=
paddle
.
reshape
(
x
=
pb
,
shape
=
[
-
1
,
4
])
pbv
=
paddle
.
reshape
(
x
=
pbv
,
shape
=
[
-
1
,
4
])
pb_dim
=
fluid
.
layers
.
shape
(
pb
)[
0
]
pb_dim
=
paddle
.
shape
(
pb
)[
0
]
loc
=
paddle
.
reshape
(
x0
,
shape
=
[
-
1
,
pb_dim
,
4
])
conf_flatten
=
paddle
.
reshape
(
x1
,
shape
=
[
0
,
pb_dim
,
-
1
])
out
=
fluid
.
layers
.
detection_output
(
...
...
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py
浏览文件 @
07929a13
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
import
paddle
import
paddle.fluid
as
fluid
class
Normalize
(
object
):
...
...
@@ -21,7 +20,7 @@ class Normalize(object):
self
.
axis
=
axis
def
__call__
(
self
,
x
,
param
):
l2_norm
=
fluid
.
layers
.
l2_normalize
(
x
=
x
,
axis
=
1
)
l2_norm
=
paddle
.
norm
(
x
=
x
,
p
=
2
,
axis
=
1
)
param
=
paddle
.
reshape
(
param
,
[
param
.
shape
[
-
1
]])
perm
=
list
(
range
(
len
(
l2_norm
.
shape
)))
perm
.
pop
(
self
.
axis
)
...
...
x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/select.py
浏览文件 @
07929a13
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
import
paddle
import
paddle.fluid
as
fluid
class
Select
(
object
):
...
...
x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py
浏览文件 @
07929a13
...
...
@@ -435,7 +435,7 @@ class CaffeOpMapper():
"beta"
:
params
.
beta
,
}
self
.
paddle_graph
.
add_layer
(
"paddle.
fluid.layers.lrn
"
,
"paddle.
nn.LocalResponseNorm
"
,
inputs
=
{
"input"
:
input
.
name
},
outputs
=
[
node
.
layer_name
],
**
layer_attrs
)
...
...
x2paddle/op_mapper/prim2code.py
浏览文件 @
07929a13
...
...
@@ -612,7 +612,7 @@ def prim_shape_dim(layer,
forward_func
=
[],
layer_id
=
None
,
different_attrs
=
None
):
line
=
"{} =
fluid.layers
.shape({})[{}]"
.
format
(
line
=
"{} =
paddle
.shape({})[{}]"
.
format
(
layer
.
outputs
[
0
],
get_value
(
layer
,
"input"
,
different_attrs
),
get_value
(
layer
,
"dim"
,
different_attrs
))
...
...
x2paddle/op_mapper/pytorch2paddle/aten.py
浏览文件 @
07929a13
...
...
@@ -6025,7 +6025,7 @@ def aten_upsample_bilinear2d(mapper, graph, node):
inputs
=
{
"input"
:
inputs_name
[
1
]},
outputs
=
[
inputs_name
[
1
]
+
"_isinstance"
],
scope_name
=
scope_name
,
cls
=
"paddle.
fluid
.Variable"
)
cls
=
"paddle.
static
.Variable"
)
# TODO(syf): paddle.Variable
graph
.
add_layer
(
"prim.if"
,
{
"input"
:
inputs_name
[
1
]
+
"_isinstance"
},
...
...
@@ -6103,7 +6103,7 @@ def aten_upsample_nearest2d(mapper, graph, node):
inputs
=
{
"input"
:
inputs_name
[
1
]},
outputs
=
[
inputs_name
[
1
]
+
"_isinstance"
],
scope_name
=
scope_name
,
cls
=
"paddle.
fluid
.Variable"
)
cls
=
"paddle.
static
.Variable"
)
# TODO(syf): paddle.Variable
graph
.
add_layer
(
"prim.if"
,
{
"input"
:
inputs_name
[
1
]
+
"_isinstance"
},
...
...
x2paddle/op_mapper/pytorch2paddle/pytorch_custom_layer/instance_norm.py
浏览文件 @
07929a13
...
...
@@ -14,7 +14,7 @@
import
paddle
from
paddle.nn.functional
import
instance_norm
from
paddle.
fluid
.initializer
import
Constant
from
paddle.
nn
.initializer
import
Constant
class
InstanceNorm
(
paddle
.
nn
.
Layer
):
...
...
x2paddle/optimizer/fusion/interpolate_bilinear_fuser.py
浏览文件 @
07929a13
...
...
@@ -46,7 +46,7 @@ class InterpolateBilinearFuser(FuseBase):
if x2271 :
x2274 = x2197[0]
x2275 = x2197[1]
x2233_isinstance = isinstance(x2233, paddle.
fluid
.Variable)
x2233_isinstance = isinstance(x2233, paddle.
static
.Variable)
if x2233_isinstance :
x2233 = x2233.numpy().tolist()
x2276 = paddle.nn.functional.interpolate(x=x2181, size=x2233, scale_factor=x2274, align_corners=False, align_mode=0, mode='bilinear')
...
...
@@ -146,7 +146,7 @@ class InterpolateBilinearFuser(FuseBase):
"prim.isinstance"
,
inputs
=
{
"input"
:
"interpolate-input-3"
},
outputs
=
[
"interpolate-input-0_isinstance"
],
cls
=
"paddle.
fluid
.Variable"
)
cls
=
"paddle.
static
.Variable"
)
pattern_block_block
.
add_layer
(
"prim.if"
,
{
"input"
:
"interpolate-input-0_isinstance"
},
outputs
=
[
"interpolate-input-0_if1"
])
...
...
x2paddle/utils.py
浏览文件 @
07929a13
...
...
@@ -103,15 +103,7 @@ class PaddleDtypes():
self
.
t_int64
=
paddle
.
int64
self
.
t_bool
=
paddle
.
bool
else
:
self
.
t_float16
=
"paddle.fluid.core.VarDesc.VarType.FP16"
self
.
t_float32
=
"paddle.fluid.core.VarDesc.VarType.FP32"
self
.
t_float64
=
"paddle.fluid.core.VarDesc.VarType.FP64"
self
.
t_uint8
=
"paddle.fluid.core.VarDesc.VarType.UINT8"
self
.
t_int8
=
"paddle.fluid.core.VarDesc.VarType.INT8"
self
.
t_int16
=
"paddle.fluid.core.VarDesc.VarType.INT16"
self
.
t_int32
=
"paddle.fluid.core.VarDesc.VarType.INT32"
self
.
t_int64
=
"paddle.fluid.core.VarDesc.VarType.INT64"
self
.
t_bool
=
"paddle.fluid.core.VarDesc.VarType.BOOL"
raise
Exception
(
"Paddle>=2.0.0 is required, Please update version!"
)
is_new_version
=
check_version
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录