forked from PaddlePaddle/PaddleTest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
3,886 additions
and
6 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/acos_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: acos_zero_size_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, x, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.acos(x, ) | ||
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 | ||
""" | ||
inputs = (paddle.to_tensor(-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), dtype='float32', stop_gradient=False), ) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = (-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), ) | ||
return inputs | ||
|
45 changes: 45 additions & 0 deletions
45
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/acosh_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: acosh_zero_size_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, x, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.acosh(x, ) | ||
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 | ||
""" | ||
inputs = (paddle.to_tensor(-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), dtype='float32', stop_gradient=False), ) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = (-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), ) | ||
return inputs | ||
|
55 changes: 55 additions & 0 deletions
55
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/addmm_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: addmm_zero_size_0_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, data, x, y, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.addmm(data, x, y, alpha=5.0, beta=0.5 ) | ||
return out | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False), | ||
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False), | ||
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
""" | ||
paddle tensor | ||
""" | ||
inputs = ( | ||
paddle.to_tensor(-10 + (10 - -10) * np.random.random([100, 0]).astype('float32'), dtype='float32', stop_gradient=False), | ||
paddle.to_tensor(-10 + (10 - -10) * np.random.random([100, 0]).astype('float32'), dtype='float32', stop_gradient=False), | ||
paddle.to_tensor(-10 + (10 - -10) * np.random.random([100, 0]).astype('float32'), dtype='float32', stop_gradient=False), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = ( | ||
-10 + (10 - -10) * np.random.random([100, 0]).astype('float32'), | ||
-10 + (10 - -10) * np.random.random([100, 0]).astype('float32'), | ||
-10 + (10 - -10) * np.random.random([100, 0]).astype('float32'), | ||
) | ||
return inputs | ||
|
52 changes: 52 additions & 0 deletions
52
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/allclose_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: allclose_zero_size_0_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, x, y, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.allclose(x, y, rtol=0.00001, atol=0.00000001 ) | ||
return out | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False), | ||
paddle.static.InputSpec(shape=(-1, -1, -1), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
""" | ||
paddle tensor | ||
""" | ||
inputs = ( | ||
paddle.to_tensor(-1 + (1 - -1) * np.random.random([100, 0, 10]).astype('float32'), dtype='float32', stop_gradient=False), | ||
paddle.to_tensor(-1 + (1 - -1) * np.random.random([100, 0, 10]).astype('float32'), dtype='float32', stop_gradient=False), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = ( | ||
-1 + (1 - -1) * np.random.random([100, 0, 10]).astype('float32'), | ||
-1 + (1 - -1) * np.random.random([100, 0, 10]).astype('float32'), | ||
) | ||
return inputs | ||
|
45 changes: 45 additions & 0 deletions
45
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/any_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: any_zero_size_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, x, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.any(x, ) | ||
return out | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, ), dtype=paddle.bool, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
""" | ||
paddle tensor | ||
""" | ||
inputs = (paddle.to_tensor(-1 + (1 - -1) * np.random.random([0]).astype('bool'), dtype='bool', stop_gradient=False), ) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = (-1 + (1 - -1) * np.random.random([0]).astype('bool'), ) | ||
return inputs | ||
|
48 changes: 48 additions & 0 deletions
48
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/arange_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: arange_zero_size_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.arange( | ||
start=0., | ||
end=0., | ||
step=0., | ||
dtype="float32", | ||
) | ||
return out | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = () | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
""" | ||
paddle tensor | ||
""" | ||
inputs = () | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = () | ||
return inputs | ||
|
45 changes: 45 additions & 0 deletions
45
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/argmax_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: argmax_zero_size_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, x, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.argmax(x, ) | ||
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 | ||
""" | ||
inputs = (paddle.to_tensor(-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), dtype='float32', stop_gradient=False), ) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = (-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), ) | ||
return inputs | ||
|
45 changes: 45 additions & 0 deletions
45
framework/e2e/PaddleLT_new/layerApicase/math_zero_size/argsort_zero_size_0_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import numpy as np | ||
import paddle | ||
|
||
|
||
class LayerCase(paddle.nn.Layer): | ||
""" | ||
case名称: argsort_zero_size_func | ||
""" | ||
|
||
def __init__(self): | ||
super(LayerCase, self).__init__() | ||
|
||
def forward(self, x, ): | ||
""" | ||
forward | ||
""" | ||
|
||
paddle.seed(33) | ||
np.random.seed(33) | ||
out = paddle.argsort(x, ) | ||
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 | ||
""" | ||
inputs = (paddle.to_tensor(-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), dtype='float32', stop_gradient=False), ) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
""" | ||
numpy array | ||
""" | ||
inputs = (-1 + (1 - -1) * np.random.random([12, 0, 10, 10]).astype('float32'), ) | ||
return inputs | ||
|
Oops, something went wrong.