Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
270d348d
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
270d348d
编写于
5月 23, 2020
作者:
Z
z00478463
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
for comments 1st
上级
81d7cc48
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
0 addition
and
1239 deletion
+0
-1239
example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py
...e/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py
+0
-75
example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py
example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py
+0
-63
example/resnet50_imagenet2012_THOR/cus_ops/cus_batch_matmul.py
...le/resnet50_imagenet2012_THOR/cus_ops/cus_batch_matmul.py
+0
-37
example/resnet50_imagenet2012_THOR/cus_ops/cus_cholesky_trsm.py
...e/resnet50_imagenet2012_THOR/cus_ops/cus_cholesky_trsm.py
+0
-37
example/resnet50_imagenet2012_THOR/cus_ops/cus_fused_abs_max1.py
.../resnet50_imagenet2012_THOR/cus_ops/cus_fused_abs_max1.py
+0
-44
example/resnet50_imagenet2012_THOR/cus_ops/cus_img2col.py
example/resnet50_imagenet2012_THOR/cus_ops/cus_img2col.py
+0
-51
example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube.py
...ple/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube.py
+0
-54
example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_dense_left.py
...0_imagenet2012_THOR/cus_ops/cus_matmul_cube_dense_left.py
+0
-40
example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_fracz_right_mul.py
...genet2012_THOR/cus_ops/cus_matmul_cube_fracz_right_mul.py
+0
-39
example/resnet50_imagenet2012_THOR/cus_ops/cus_matrix_combine.py
.../resnet50_imagenet2012_THOR/cus_ops/cus_matrix_combine.py
+0
-41
example/resnet50_imagenet2012_THOR/cus_ops/cus_transpose02314.py
.../resnet50_imagenet2012_THOR/cus_ops/cus_transpose02314.py
+0
-44
example/resnet50_imagenet2012_THOR/cus_ops/fused_abs_max1.py
example/resnet50_imagenet2012_THOR/cus_ops/fused_abs_max1.py
+0
-69
example/resnet50_imagenet2012_THOR/cus_ops/img2col_impl.py
example/resnet50_imagenet2012_THOR/cus_ops/img2col_impl.py
+0
-87
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_dense_left.py
...net50_imagenet2012_THOR/cus_ops/matmul_cube_dense_left.py
+0
-102
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_left_cast_impl.py
...enet2012_THOR/cus_ops/matmul_cube_fracz_left_cast_impl.py
+0
-103
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py
...enet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py
+0
-113
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_impl.py
...le/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_impl.py
+0
-114
example/resnet50_imagenet2012_THOR/cus_ops/matrix_combine_impl.py
...resnet50_imagenet2012_THOR/cus_ops/matrix_combine_impl.py
+0
-63
example/resnet50_imagenet2012_THOR/cus_ops/transpose02314_impl.py
...resnet50_imagenet2012_THOR/cus_ops/transpose02314_impl.py
+0
-63
未找到文件。
example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""batch_matmul_impl"""
from
mindspore.ops.op_info_register
import
op_info_register
@
op_info_register
(
"""{
"op_name": "CusBatchMatMul",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "batchmatmul.so",
"compute_cost": 10,
"kernel_name": "CusBatchMatMul",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 1,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "x2",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusBatchMatMul
(
input_x1
,
input_x2
,
output
,
transpose_a
=
False
,
transpose_b
=
True
,
kernel_name
=
"batchmatmul"
):
"""CusBatchMatMul"""
return
example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusCholeskyTrsm"""
from
mindspore.ops.op_info_register
import
op_info_register
@
op_info_register
(
"""{
"op_name": "CusCholeskyTrsm",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "choleskytrsm.so",
"compute_cost": 10,
"kernel_name": "CusCholeskyTrsm",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusCholeskyTrsm
(
input_x
,
output
,
kernel_name
):
"""CusCholeskyTrsm"""
return
example/resnet50_imagenet2012_THOR/cus_ops/cus_batch_matmul.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusBatchMatMul"""
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
class
CusBatchMatMul
(
PrimitiveWithInfer
):
"""CusMatMulCube definition"""
@
prim_attr_register
def
__init__
(
self
):
"""init CusMatMulCube"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
,
'x2'
],
outputs
=
[
'y'
])
def
get_bprop
(
self
):
def
bprop
(
x1
,
x2
,
out
,
dout
):
return
(
C
.
zeros_like
(
x1
),
C
.
zeros_like
(
x2
))
return
bprop
def
infer_shape
(
self
,
data1_shape
,
data2_shape
):
return
data1_shape
def
infer_dtype
(
self
,
data1_dtype
,
data2_dtype
):
return
data1_dtype
example/resnet50_imagenet2012_THOR/cus_ops/cus_cholesky_trsm.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusCholeskyTrsm"""
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
class
CusCholeskyTrsm
(
PrimitiveWithInfer
):
"""CusCholeskyTrsm definition"""
@
prim_attr_register
def
__init__
(
self
):
"""init CusCholeskyTrsm"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
],
outputs
=
[
'y'
])
def
infer_shape
(
self
,
data1_shape
):
ll
=
[]
m
,
_
=
data1_shape
if
m
>=
128
:
ll
=
[
m
//
128
,
128
,
128
]
else
:
ll
=
[
1
,
64
,
64
]
return
ll
def
infer_dtype
(
self
,
data1_dtype
):
return
data1_dtype
example/resnet50_imagenet2012_THOR/cus_ops/cus_fused_abs_max1.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusFusedAbsMax1"""
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
class
CusFusedAbsMax1
(
PrimitiveWithInfer
):
"""CusCholeskyTrsm definition"""
@
prim_attr_register
def
__init__
(
self
,
origin_shape
=
[
-
1
,
-
1
]):
"""init CusCholeskyTrsm"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
],
outputs
=
[
'y'
])
self
.
origin_shape
=
origin_shape
def
get_bprop
(
self
):
def
bprop
(
x
,
out
,
dout
):
return
(
C
.
zeros_like
(
x
),)
return
bprop
def
infer_shape
(
self
,
data1_shape
):
ll
=
[]
if
len
(
data1_shape
)
==
2
:
ll
=
[
1
,]
else
:
ll
=
[
32
,
64
]
return
ll
def
infer_dtype
(
self
,
data1_dtype
):
return
data1_dtype
example/resnet50_imagenet2012_THOR/cus_ops/cus_img2col.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusImg2Col"""
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
class
CusImg2Col
(
PrimitiveWithInfer
):
"""CusImg2Col definition"""
@
prim_attr_register
def
__init__
(
self
,
ksizes
,
strides
,
dilates
=
(
1
,
1
,
1
,
1
),
mode
=
"NC1HWC0"
):
"""init CusImg2Col"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
],
outputs
=
[
'y'
])
self
.
ksizes
=
ksizes
self
.
strides
=
strides
self
.
dilates
=
dilates
self
.
mode
=
mode
def
get_bprop
(
self
):
def
bprop
(
x
,
out
,
dout
):
return
(
C
.
zeros_like
(
x
),)
return
bprop
def
infer_shape
(
self
,
data1_shape
):
bs
,
c
,
h
,
w
=
data1_shape
_
,
stride_h
,
stride_w
,
_
=
self
.
strides
_
,
k_w
,
k_h
,
_
=
self
.
ksizes
# assert m == n
c0
=
16
c1
=
c
//
16
if
c1
==
0
:
c1
=
1
shape
=
[
bs
*
int
(
h
//
stride_h
)
*
int
(
w
//
stride_w
),
k_w
*
k_h
*
c1
*
c0
]
return
shape
def
infer_dtype
(
self
,
data1_dtype
):
return
data1_dtype
example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusMatMulCube"""
import
mindspore
as
ms
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
# y = x^2
class
CusMatMulCube
(
PrimitiveWithInfer
):
"""CusMatMulCube definition"""
@
prim_attr_register
def
__init__
(
self
,
transpose_a
=
False
,
transpose_b
=
False
):
"""init CusMatMulCube"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
,
'x2'
],
outputs
=
[
'y'
])
self
.
transpose_a
=
transpose_a
self
.
transpose_b
=
transpose_b
def
get_bprop
(
self
):
def
bprop
(
x1
,
x2
,
out
,
dout
):
return
(
C
.
zeros_like
(
x1
),
C
.
zeros_like
(
x2
))
return
bprop
def
infer_shape
(
self
,
data1_shape
,
data2_shape
):
# shape = [1, data1_shape[1], data2_shape[2], 16, 16]
# return shape
if
self
.
transpose_a
:
k1
,
m
=
data1_shape
else
:
m
,
k1
=
data1_shape
if
self
.
transpose_b
:
n
,
k2
=
data2_shape
else
:
k2
,
n
=
data2_shape
assert
k1
==
k2
shape
=
[
m
,
n
]
return
shape
def
infer_dtype
(
self
,
data1_dtype
,
data2_dtype
):
return
ms
.
common
.
dtype
.
tensor_type
(
getattr
(
ms
,
"float32"
))
example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_dense_left.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusMatMulCubeDenseLeft"""
import
mindspore
as
ms
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
# y = x^2
class
CusMatMulCubeDenseLeft
(
PrimitiveWithInfer
):
"""CusMatMulCube definition"""
@
prim_attr_register
def
__init__
(
self
):
"""init CusMatMulCube"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
,
'x2'
],
outputs
=
[
'y'
])
def
get_bprop
(
self
):
def
bprop
(
x1
,
x2
,
out
,
dout
):
return
(
C
.
zeros_like
(
x1
),
C
.
zeros_like
(
x2
))
return
bprop
def
infer_shape
(
self
,
data1_shape
,
data2_shape
):
return
data2_shape
def
infer_dtype
(
self
,
data1_dtype
,
data2_dtype
):
return
ms
.
common
.
dtype
.
tensor_type
(
getattr
(
ms
,
"float16"
))
example/resnet50_imagenet2012_THOR/cus_ops/cus_matmul_cube_fracz_right_mul.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusMatMulCubeFraczRightMul"""
import
mindspore
as
ms
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
class
CusMatMulCubeFraczRightMul
(
PrimitiveWithInfer
):
"""CusMatMulCubeFraczRightMul definition"""
@
prim_attr_register
def
__init__
(
self
):
"""init CusMatMulCubeFraczRightMul"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
,
'x2'
,
'x3'
],
outputs
=
[
'y'
])
def
get_bprop
(
self
):
def
bprop
(
x1
,
x2
,
x3
,
out
,
dout
):
return
(
C
.
zeros_like
(
x1
),
C
.
zeros_like
(
x2
),
C
.
zeros_like
(
x3
))
return
bprop
def
infer_shape
(
self
,
data1_shape
,
data2_shape
,
data3_shape
):
return
data1_shape
def
infer_dtype
(
self
,
data1_dtype
,
data2_dtype
,
data3_dtype
):
return
ms
.
common
.
dtype
.
tensor_type
(
getattr
(
ms
,
"float32"
))
example/resnet50_imagenet2012_THOR/cus_ops/cus_matrix_combine.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusMatrixCombine"""
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
class
CusMatrixCombine
(
PrimitiveWithInfer
):
"""CusMatMulCube definition"""
@
prim_attr_register
def
__init__
(
self
):
"""init CusMatMulCube"""
self
.
init_prim_io_names
(
inputs
=
[
'x'
],
outputs
=
[
'y'
])
def
get_bprop
(
self
):
def
bprop
(
x
,
out
,
dout
):
return
(
C
.
zeros_like
(
x
),)
return
bprop
def
infer_shape
(
self
,
data_shape
):
a
,
b
,
c
=
data_shape
shape
=
[
a
*
b
,
a
*
c
]
return
shape
def
infer_dtype
(
self
,
data_dtype
):
return
data_dtype
example/resnet50_imagenet2012_THOR/cus_ops/cus_transpose02314.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusTranspose02314"""
from
mindspore.ops
import
prim_attr_register
,
PrimitiveWithInfer
from
mindspore.ops.composite
import
multitype_ops
as
C
class
CusTranspose02314
(
PrimitiveWithInfer
):
"""CusTranspose02314 definition"""
@
prim_attr_register
def
__init__
(
self
):
"""init CusTranspose02314"""
self
.
init_prim_io_names
(
inputs
=
[
'x1'
],
outputs
=
[
'y'
])
def
get_bprop
(
self
):
def
bprop
(
x
,
out
,
dout
):
return
(
C
.
zeros_like
(
x
),)
return
bprop
def
infer_shape
(
self
,
data1_shape
):
assert
len
(
data1_shape
)
==
4
n
,
c
,
h
,
w
=
data1_shape
c0
=
16
c1
=
c
//
16
shape
=
(
n
*
h
*
w
,
c1
*
c0
)
return
shape
def
infer_dtype
(
self
,
data1_dtype
):
return
data1_dtype
example/resnet50_imagenet2012_THOR/cus_ops/fused_abs_max1.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusFusedAbsMax1"""
from
mindspore.ops.op_info_register
import
op_info_register
@
op_info_register
(
"""{
"op_name": "CusFusedAbsMax1",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "fusedabsmax1.so",
"compute_cost": 10,
"kernel_name": "CusFusedAbsMax1",
"partial_flag": true,
"attr": [
{
"name": "origin_shape",
"param_type": "required",
"type": "listInt",
"value": "all"
}
],
"inputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusFusedAbsMax1
(
input_x
,
output
,
origin_shape
=
None
,
kernel_name
=
"fused_abs_max1"
):
"""CusFusedAbsMax1"""
return
example/resnet50_imagenet2012_THOR/cus_ops/img2col_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusImg2ColNC1HWC0"""
from
mindspore.ops.op_info_register
import
op_info_register
@
op_info_register
(
"""{
"op_name": "CusImg2ColNC1HWC0",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "img2colnc1hwc0.so",
"compute_cost": 10,
"kernel_name": "CusImg2ColNC1HWC0",
"partial_flag": true,
"attr": [
{
"name": "ksizes",
"param_type": "required",
"type": "listInt",
"value": "all"
},
{
"name": "strides",
"param_type": "required",
"type": "listInt",
"value": "all"
},
{
"name": "dilates",
"param_type": "required",
"type": "listInt",
"value": "all"
},
{
"name": "padding",
"param_type": "required",
"type": "str",
"value": "all"
}
],
"inputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"NC1HWC0"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"FRACTAL_NZ"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusImg2ColNC1HWC0
(
input_x
,
output
,
ksizes
,
strides
,
dilates
,
padding
,
kernel_name
=
"img2col"
):
"""CusImg2ColNC1HWC0"""
return
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_dense_left.py
已删除
100644 → 0
浏览文件 @
81d7cc48
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
copyright 2020 Huawei Technologies Co., Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License == distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
matmul
"""
from
__future__
import
absolute_import
from
mindspore.ops.op_info_register
import
op_info_register
from
topi.cce
import
util
# General limitation of the size for input shape: 2**31
SHAPE_SIZE_LIMIT
=
2147483648
NoneType
=
type
(
None
)
@
op_info_register
(
"""{
"op_name": "CusMatMulCubeDenseLeft",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "matmulcubedenseleft.so",
"compute_cost": 10,
"kernel_name": "CusMatMulCubeDenseLeft",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 1,
"dtype": [
"float16"
],
"format": [
"FRACTAL_NZ"
],
"name": "x2",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 2,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x3",
"need_compile": false,
"param_type": "optional",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"FRACTAL_NZ"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
@
util
.
check_input_type
(
dict
,
dict
,
(
dict
,
NoneType
),
dict
,
bool
,
bool
,
str
)
def
CusMatMulCubeDenseLeft
(
input_x1
,
input_x2
,
bias
=
None
,
output_y
=
{},
trans_a
=
False
,
trans_b
=
False
,
kernel_name
=
"matmulcube"
):
"""CusMatMulCubeDenseLeft"""
return
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_left_cast_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
copyright 2020 Huawei Technologies Co., Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License == distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
matmul
"""
from
__future__
import
absolute_import
from
mindspore.ops.op_info_register
import
op_info_register
from
topi.cce
import
util
# General limitation of the size for input shape: 2**31
SHAPE_SIZE_LIMIT
=
2147483648
NoneType
=
type
(
None
)
@
op_info_register
(
"""{
"op_name": "CusMatMulCubeFraczLeftCast",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "matmulcubefraczleftcast.so",
"compute_cost": 10,
"kernel_name": "CusMatMulCubeFraczLeftCast",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 1,
"dtype": [
"float32"
],
"format": [
"FracZ"
],
"name": "x2",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 2,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x3",
"need_compile": false,
"param_type": "optional",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"FracZ"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
# pylint: disable=locally-disabled,too-many-arguments, too-many-locals, too-many-statements
@
util
.
check_input_type
(
dict
,
dict
,
(
dict
,
NoneType
),
dict
,
bool
,
bool
,
str
)
def
CusMatMulCubeFraczLeftCast
(
input_x1
,
input_x2
,
bias
=
None
,
output_y
=
{},
trans_a
=
False
,
trans_b
=
False
,
kernel_name
=
"CusMatMulCubeFraczLeftCast"
):
"""CusMatMulCubeFraczLeftCast"""
return
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
copyright 2020 Huawei Technologies Co., Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License == distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
matmul
"""
from
__future__
import
absolute_import
from
mindspore.ops.op_info_register
import
op_info_register
# General limitation of the size for input shape: 2**31
SHAPE_SIZE_LIMIT
=
2147483648
NoneType
=
type
(
None
)
@
op_info_register
(
"""{
"op_name": "CusMatMulCubeFraczRightMul",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "matmulcubefraczrightmul.so",
"compute_cost": 10,
"kernel_name": "CusMatMulCubeFraczRightMul",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"FracZ"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 1,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x2",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 2,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "x3",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 3,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x4",
"need_compile": false,
"param_type": "optional",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"FracZ"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusMatMulCubeFraczRightMul
(
input_x1
,
input_x2
,
input_x3
,
bias
=
None
,
output_y
=
{},
trans_a
=
False
,
trans_b
=
False
,
kernel_name
=
"matmulcube"
):
"""CusMatMulCubeFraczRightMul"""
return
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
copyright 2020 Huawei Technologies Co., Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License == distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
matmul
"""
from
__future__
import
absolute_import
from
mindspore.ops.op_info_register
import
op_info_register
from
topi.cce
import
util
# General limitation of the size for input shape: 2**31
SHAPE_SIZE_LIMIT
=
2147483648
NoneType
=
type
(
None
)
@
op_info_register
(
"""{
"op_name": "CusMatMulCube",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "matmulcube.so",
"compute_cost": 10,
"kernel_name": "CusMatMulCube",
"partial_flag": true,
"attr": [
{
"name": "transpose_a",
"param_type": "required",
"type": "bool",
"value": "all"
},
{
"name": "transpose_b",
"param_type": "required",
"type": "bool",
"value": "all"
}
],
"inputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"FRACTAL_NZ"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 1,
"dtype": [
"float16"
],
"format": [
"FRACTAL_NZ"
],
"name": "x2",
"need_compile": false,
"param_type": "required",
"shape": "all"
},
{
"index": 2,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "x3",
"need_compile": false,
"param_type": "optional",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"FRACTAL_NZ"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
# pylint: disable=locally-disabled,too-many-arguments, too-many-locals, too-many-statements
@
util
.
check_input_type
(
dict
,
dict
,
(
dict
,
NoneType
),
dict
,
bool
,
bool
,
str
)
def
CusMatMulCube
(
input_x1
,
input_x2
,
bias
=
None
,
output_y
=
{},
trans_a
=
False
,
trans_b
=
False
,
kernel_name
=
"matmulcube"
):
"""CusMatMulCube"""
return
example/resnet50_imagenet2012_THOR/cus_ops/matrix_combine_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusMatrixCombine"""
from
mindspore.ops.op_info_register
import
op_info_register
@
op_info_register
(
"""{
"op_name": "CusMatrixCombine",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "matrixcombine.so",
"compute_cost": 10,
"kernel_name": "CusMatrixCombine",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float32"
],
"format": [
"DefaultFormat"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusMatrixCombine
(
input_x
,
output
,
kernel_name
=
"matrix_combine"
):
"""CusMatrixCombine"""
return
example/resnet50_imagenet2012_THOR/cus_ops/transpose02314_impl.py
已删除
100644 → 0
浏览文件 @
81d7cc48
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""CusTranspose02314"""
from
mindspore.ops.op_info_register
import
op_info_register
@
op_info_register
(
"""{
"op_name": "CusTranspose02314",
"imply_type": "TBE",
"fusion_type": "OPAQUE",
"async_flag": false,
"binfile_name": "transpose02314.so",
"compute_cost": 10,
"kernel_name": "CusTranspose02314",
"partial_flag": true,
"attr": [
],
"inputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"NC1HWC0"
],
"name": "x1",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
],
"outputs": [
{
"index": 0,
"dtype": [
"float16"
],
"format": [
"DefaultFormat"
],
"name": "y",
"need_compile": false,
"param_type": "required",
"shape": "all"
}
]
}"""
)
def
CusTranspose02314
(
input_x
,
output
,
kernel_name
=
"transpose021354"
):
"""CusTranspose02314"""
return
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录