forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from mangguo321/mang/merge_to_yi_branch
Mang/merge to yi branch
- Loading branch information
Showing
5 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
Submodule mkl-dnn
updated
2 files
+119 −122 | src/cpu/x64/gemm/gemm_info.cpp | |
+2 −1 | src/cpu/x64/jit_gemm_inner_product_utils.cpp |
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
43 changes: 43 additions & 0 deletions
43
ngraph/test/files/paddlepaddle/gen_scripts/generate_reshape.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,43 @@ | ||
# | ||
# reshape paddle model generator | ||
# | ||
import numpy as np | ||
from save_model import saveModel | ||
|
||
data_type = 'float32' | ||
|
||
def reshape(name : str, x, out_shape): | ||
import paddle as pdpd | ||
pdpd.enable_static() | ||
|
||
with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()): | ||
node_x = pdpd.static.data(name='x', shape=x.shape, dtype=data_type) | ||
out = pdpd.fluid.layers.reshape(x=node_x, shape=out_shape) | ||
|
||
cpu = pdpd.static.cpu_places(1) | ||
exe = pdpd.static.Executor(cpu[0]) | ||
# startup program will call initializer to initialize the parameters. | ||
exe.run(pdpd.static.default_startup_program()) | ||
|
||
outs = exe.run( | ||
feed={'x': x}, | ||
fetch_list=[out]) | ||
|
||
saveModel(name, exe, feedkeys=['x'], fetchlist=[out], inputs=[x], outputs=[outs[0]]) | ||
|
||
return outs[0] | ||
|
||
def main(): | ||
data = np.array([[[ | ||
[1, 2, 3, 4], | ||
[5, 6, 7, 8], | ||
[9, 10, 11, 12], | ||
[13, 14, 15, 16], | ||
]]], dtype=np.float32) | ||
out_shape = [1, 1, 2, 8] | ||
reshape("reshape", data, out_shape) | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
main() |
48 changes: 48 additions & 0 deletions
48
ngraph/test/files/paddlepaddle/gen_scripts/generate_scale.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 @@ | ||
# | ||
# pool2d paddle model generator | ||
# | ||
import numpy as np | ||
from save_model import saveModel | ||
|
||
data_type = 'float32' | ||
|
||
def pdpd_scale(name : str, x, scale, bias, attrs : dict): | ||
import paddle as pdpd | ||
pdpd.enable_static() | ||
|
||
with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()): | ||
node_x = pdpd.static.data(name='x', shape=x.shape, dtype='float32') | ||
out = pdpd.scale(x=node_x, scale=scale, bias=bias, | ||
bias_after_scale=attrs['bias_after_scale']) | ||
|
||
cpu = pdpd.static.cpu_places(1) | ||
exe = pdpd.static.Executor(cpu[0]) | ||
# startup program will call initializer to initialize the parameters. | ||
exe.run(pdpd.static.default_startup_program()) | ||
|
||
outs = exe.run( | ||
feed={'x': x}, | ||
fetch_list=[out]) | ||
|
||
saveModel(name, exe, feedkeys=['x'], fetchlist=[out], inputs=[x], outputs=[outs[0]]) | ||
|
||
return outs[0] | ||
|
||
|
||
def main(): | ||
scale = 2.0 | ||
bias = 1.0 | ||
data = np.random.random([2, 3]).astype("float32") | ||
pdpd_attrs = { | ||
'bias_after_scale' : True, | ||
} | ||
pdpd_scale("scale_test1", data, scale, bias, pdpd_attrs) | ||
|
||
pdpd_attrs = { | ||
'bias_after_scale' : False, | ||
} | ||
pdpd_scale("scale_test2", data, scale, bias, pdpd_attrs) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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