Skip to content

Commit

Permalink
plt fix api case (#2945)
Browse files Browse the repository at this point in the history
* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* add plt export, test=model

* fix plt start, test=model

* fix plt start, test=model

* fix plt start, test=model

* fix plt start, test=model

* fix plt perf, test=model

* add plt bm ignore, test=model

* update plt start.sh, test=model

* update plt start.sh, test=model

* add inputspec plt ci, test=model

* add inputspec plt ci, test=model

* update plt ci, test=model

* update plt ci, test=model

* update plt ci, test=model

* update plt ci, test=model

* update plt ci, test=model

* update plt gsb, test=model

* fix plt statistic, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* plt update net instance, test=model

* fix plt tools, test=model

* update ply add model case, test=model

* update ply add model case, test=model

* update ply add model case, test=model

* fix plt api case, test=model
  • Loading branch information
Zeref996 authored Sep 12, 2024
1 parent b304ade commit 7d678d6
Show file tree
Hide file tree
Showing 64 changed files with 304 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import glob

# 获取当前文件所在目录
current_dir = os.path.dirname(__file__)

# 获取当前目录下所有的 .py 文件路径
py_files = glob.glob(os.path.join(current_dir, "*.py"))

# 动态导入所有 .py 文件
for py_file in py_files:
# 获取文件名(不含扩展名)
module_name = os.path.basename(py_file)[:-3]
# 导入模块
__import__('layerApicase.inplace_stragtegy.' + module_name, globals(), locals(), [])
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def forward(self, ):
forward
"""
out = paddle.broadcast_shape( x_shape=[2, 1, 3, 1, 4, 2, 3], y_shape=[1, 2, 1, 1, 3], )
out = paddle.to_tensor(out, stop_gradient=False)
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def forward(self, ):
forward
"""
out = paddle.broadcast_shape( x_shape=[2, 3, 4, 4, 1], y_shape=[2, 3, 1, 4, 3], )
out = paddle.to_tensor(out, stop_gradient=False)
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def forward(self, x, y, ):
"""
forward
"""
out = paddle.dist(x, y, p=-inf, )
out = paddle.dist(x, y, p=float("-inf"), )
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def forward(self, x, y, ):
"""
forward
"""
out = paddle.dist(x, y, p=inf, )
out = paddle.dist(x, y, p=float("inf"), )
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def forward(self, x, ):
"""
forward
"""
out = paddle.median(x, axis=1, keepdims=True, )
out = paddle.median(x, axis=1, keepdim=True, )
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def forward(self, x, ):
"""
forward
"""
out = paddle.median(x, axis=0, keepdims=False, )
out = paddle.median(x, axis=0, keepdim=False, )
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def forward(self, arr, ):
"""
forward
"""
out = paddle.put_along_axis(arr, indices=paddle.to_tensor([[[[0]]]], dtype='int32', stop_gradient=False), value=21.0, axis=0, )
out = paddle.put_along_axis(arr, indices=paddle.to_tensor([[[[0]]]], dtype='int32', stop_gradient=False), values=21.0, axis=0, )
return out


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
numpy array
"""
inputs = ()
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False),)
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[0.6964692], [0.28613934]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[0.6964692], [0.28613934]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[0.6964692], [0.28613934]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[[0.6964692, 0.28613934, 0.22685145]], [[0.5513148, 0.71946895, 0.42310646]]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,25 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
"""
inputs = ()
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
return inputs


def create_numpy_inputs():
"""
numpy array
"""
inputs = (paddle.to_tensor([[0.6964692], [0.28613934]], dtype='float32', stop_gradient=False), )
inputs = (np.array([[0.6964692], [0.28613934]]).astype('float32'), )
return inputs

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def forward(self, data, ):
return out


def create_inputspec():
inputspec = (
paddle.static.InputSpec(shape=(-1, -1, -1, -1), dtype=paddle.float32, stop_gradient=False),
)
return inputspec


def create_tensor_inputs():
"""
paddle tensor
Expand Down
Loading

0 comments on commit 7d678d6

Please sign in to comment.