Esempio n. 1
0
#
# 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.
# ============================================================================
"""Round op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("Round") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "output") \
    .dtype_format(DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default) \
    .dtype_format(DT.I32_Default, DT.I32_Default) \
    .get_op_info()


@op_info_register(op_info)
def _round_akg():
    """Round Akg register"""
    return
Esempio n. 2
0
# 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.
"""Tile op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

tile_op_info = AkgGpuRegOp("Tile") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "output") \
    .attr("multiples", "required", "listInt") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default) \
    .dtype_format(DataType.F64_Default, DataType.F64_Default) \
    .dtype_format(DataType.I16_Default, DataType.I16_Default) \
    .dtype_format(DataType.I32_Default, DataType.I32_Default) \
    .dtype_format(DataType.I64_Default, DataType.I64_Default) \
    .get_op_info()


@op_info_register(tile_op_info)
def _tile_akg():
    """Tile AutoDiff register"""
    return
Esempio n. 3
0
# Copyright 2019 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.
"""SimpleMeanGrad op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

mean_grad_op_info = AkgGpuRegOp("SimpleMeanGrad") \
    .fusion_type("OPAQUE") \
    .input(0, "HEAD") \
    .output(0, "output") \
    .attr("input_shape", "required", "listInt") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default) \
    .get_op_info()


@op_info_register(mean_grad_op_info)
def _simple_mean_grad_akg():
    """SimpleMeanGrad AutoDiff register"""
    return
Esempio n. 4
0
cast_op_info = AkgGpuRegOp("Cast") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "output") \
    .attr("dst_type", "required", "str") \
    .dtype_format(DataType.F16_Default, DataType.F32_Default) \
    .dtype_format(DataType.F16_Default, DataType.I32_Default) \
    .dtype_format(DataType.F16_Default, DataType.F64_Default) \
    .dtype_format(DataType.F16_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I32_Default, DataType.F16_Default) \
    .dtype_format(DataType.I32_Default, DataType.F32_Default) \
    .dtype_format(DataType.I32_Default, DataType.F64_Default) \
    .dtype_format(DataType.I32_Default, DataType.I64_Default) \
    .dtype_format(DataType.I32_Default, DataType.I8_Default) \
    .dtype_format(DataType.I32_Default, DataType.U8_Default) \
    .dtype_format(DataType.I32_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I8_Default, DataType.F64_Default) \
    .dtype_format(DataType.I8_Default, DataType.F32_Default) \
    .dtype_format(DataType.I8_Default, DataType.F16_Default) \
    .dtype_format(DataType.I8_Default, DataType.I32_Default) \
    .dtype_format(DataType.I8_Default, DataType.I16_Default) \
    .dtype_format(DataType.I8_Default, DataType.I64_Default) \
    .dtype_format(DataType.I8_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.F32_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.F16_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.F64_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.I8_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.I16_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.I32_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.I64_Default) \
    .dtype_format(DataType.U8_Default, DataType.F32_Default) \
    .dtype_format(DataType.U8_Default, DataType.F16_Default) \
    .dtype_format(DataType.U8_Default, DataType.I32_Default) \
    .dtype_format(DataType.U8_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I16_Default, DataType.F64_Default) \
    .dtype_format(DataType.I16_Default, DataType.F32_Default) \
    .dtype_format(DataType.I16_Default, DataType.F16_Default) \
    .dtype_format(DataType.I16_Default, DataType.I32_Default) \
    .dtype_format(DataType.I16_Default, DataType.I64_Default) \
    .dtype_format(DataType.I16_Default, DataType.F32_Default) \
    .dtype_format(DataType.I16_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I64_Default, DataType.F64_Default) \
    .dtype_format(DataType.I64_Default, DataType.F32_Default) \
    .dtype_format(DataType.I64_Default, DataType.F16_Default) \
    .dtype_format(DataType.I64_Default, DataType.I32_Default) \
    .dtype_format(DataType.I64_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.F32_Default, DataType.I32_Default) \
    .dtype_format(DataType.F32_Default, DataType.F16_Default) \
    .dtype_format(DataType.F32_Default, DataType.F64_Default) \
    .dtype_format(DataType.F32_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.F32_Default, DataType.I8_Default) \
    .dtype_format(DataType.F32_Default, DataType.I16_Default) \
    .dtype_format(DataType.F32_Default, DataType.I64_Default) \
    .dtype_format(DataType.F32_Default, DataType.U8_Default) \
    .dtype_format(DataType.F32_Default, DataType.U16_Default) \
    .dtype_format(DataType.F32_Default, DataType.U32_Default) \
    .dtype_format(DataType.F32_Default, DataType.U64_Default) \
    .dtype_format(DataType.F64_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.F64_Default, DataType.F32_Default) \
    .dtype_format(DataType.F64_Default, DataType.F16_Default) \
    .dtype_format(DataType.F64_Default, DataType.I64_Default) \
    .dtype_format(DataType.F64_Default, DataType.I32_Default) \
    .dtype_format(DataType.F64_Default, DataType.I16_Default) \
    .dtype_format(DataType.F64_Default, DataType.I8_Default) \
    .get_op_info()
Esempio n. 5
0
#
# 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.
# ============================================================================
"""Abs op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("Abs") \
    .fusion_type("ELEMWISE") \
    .input(0, "x") \
    .output(0, "output") \
    .dtype_format(DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default) \
    .dtype_format(DT.I32_Default, DT.I32_Default) \
    .get_op_info()


@op_info_register(op_info)
def _abs_akg():
    """Abs Akg register"""
    return
Esempio n. 6
0
#
# 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.
"""NotEqual op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

notequal_op_info = AkgGpuRegOp("NotEqual") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .input(1, "y") \
    .output(0, "output") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I32_Default, DataType.I32_Default, DataType.BOOL_Default) \
    .get_op_info()


@op_info_register(notequal_op_info)
def _notequal_akg():
    """NotEqual AutoDiff register"""
    return
Esempio n. 7
0
# 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.
"""HSigmoidGrad op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

hsigmoidgrad_op_info = AkgGpuRegOp("HSigmoidGrad") \
    .fusion_type("OPAQUE") \
    .input(0, "y_grad") \
    .input(1, "x") \
    .output(0, "output") \
    .dtype_format(DataType.F32_Default, DataType.F32_Default, DataType.F32_Default) \
    .dtype_format(DataType.F16_Default, DataType.F16_Default, DataType.F16_Default) \
    .get_op_info()


@op_info_register(hsigmoidgrad_op_info)
def _hsigmoid_grad_akg():
    """HSigmoidGrad AutoDiff register"""
    return
Esempio n. 8
0
# 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.
# ============================================================================
"""Maximum op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("Maximum") \
    .fusion_type("COMMREDUCE") \
    .input(0, "x") \
    .input(1, "y") \
    .output(0, "output") \
    .dtype_format(DT.F16_Default, DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default, DT.F32_Default) \
    .dtype_format(DT.I32_Default, DT.I32_Default, DT.I32_Default) \
    .get_op_info()


@op_info_register(op_info)
def _maximum_akg():
    """Maximum Akg register"""
    return
Esempio n. 9
0
# 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.
# ============================================================================
"""Greater op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("Greater") \
    .fusion_type("ELEMWISE") \
    .input(0, "x") \
    .input(1, "y") \
    .output(0, "output") \
    .dtype_format(DT.F16_Default, DT.F16_Default, DT.BOOL_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default, DT.BOOL_Default) \
    .dtype_format(DT.F16_5HD, DT.F16_5HD, DT.BOOL_5HD) \
    .dtype_format(DT.F32_5HD, DT.F32_5HD, DT.BOOL_5HD) \
    .get_op_info()


@op_info_register(op_info)
def _greater_akg():
    """Greater Akg register"""
    return
Esempio n. 10
0
# 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.
"""HSwish op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

hswish_op_info = AkgGpuRegOp("HSwish") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "output") \
    .dtype_format(DataType.F32_Default, DataType.F32_Default) \
    .dtype_format(DataType.F16_Default, DataType.F16_Default) \
    .get_op_info()


@op_info_register(hswish_op_info)
def _hswish_akg():
    """HSwish AutoDiff register"""
    return
Esempio n. 11
0
# 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.
# ============================================================================
"""AddN op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("AddN") \
    .fusion_type("ELEMWISE") \
    .input(0, "inputs", "dynamic") \
    .output(0, "output") \
    .dtype_format(DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default) \
    .get_op_info()


@op_info_register(op_info)
def _addn_akg():
    """AddN Akg register"""
    return
Esempio n. 12
0
# 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.
# ============================================================================
"""ReduceSum op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("ReduceSum") \
    .fusion_type("COMMREDUCE") \
    .input(0, "x") \
    .output(0, "output") \
    .attr("axis", "required", "listInt") \
    .attr("keep_dims", "required", "bool") \
    .dtype_format(DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default) \
    .get_op_info()


@op_info_register(op_info)
def _reduce_sum_akg():
    """ReduceSum Akg register"""
    return
Esempio n. 13
0
# 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.
"""Squeeze op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

squeeze_op_info = AkgGpuRegOp("Squeeze") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "output") \
    .attr("axis", "optional", "listInt") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default) \
    .dtype_format(DataType.I32_Default, DataType.I32_Default) \
    .dtype_format(DataType.I16_Default, DataType.I16_Default) \
    .dtype_format(DataType.U8_Default, DataType.U8_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.BOOL_Default) \
    .get_op_info()


@op_info_register(squeeze_op_info)
def _squeeze_akg():
    """Squeeze AutoDiff register"""
    return
Esempio n. 14
0
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

"""Reshape op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("Reshape") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "y") \
    .attr("shape", "required", "listInt") \
    .dtype_format(DT.BOOL_Default, DT.BOOL_Default) \
    .dtype_format(DT.I8_Default, DT.I8_Default) \
    .dtype_format(DT.I16_Default, DT.I16_Default) \
    .dtype_format(DT.I32_Default, DT.I32_Default) \
    .dtype_format(DT.I64_Default, DT.I64_Default) \
    .dtype_format(DT.U8_Default, DT.U8_Default) \
    .dtype_format(DT.U16_Default, DT.U16_Default) \
    .dtype_format(DT.U32_Default, DT.U32_Default) \
    .dtype_format(DT.U64_Default, DT.U64_Default) \
    .dtype_format(DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default) \
    .dtype_format(DT.F64_Default, DT.F64_Default) \
    .get_op_info()

@op_info_register(op_info)
def _reshape_akg():
    """Reshape Akg register"""
    return
Esempio n. 15
0
# 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.
# ============================================================================
"""InplaceAssign op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("InplaceAssign") \
    .fusion_type("ELEMWISE") \
    .input(0, "x") \
    .input(1, "y") \
    .input(2, "z") \
    .output(0, "output") \
    .attr("fake_output", "optional", "bool") \
    .dtype_format(DT.F16_Default, DT.F16_Default, DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default, DT.F32_Default, DT.F32_Default) \
    .dtype_format(DT.I32_Default, DT.I32_Default, DT.I32_Default, DT.I32_Default) \
    .dtype_format(DT.F16_5HD, DT.F16_5HD, DT.F16_5HD, DT.F16_5HD) \
    .dtype_format(DT.F32_5HD, DT.F32_5HD, DT.F32_5HD, DT.F32_5HD) \
    .dtype_format(DT.I32_5HD, DT.I32_5HD, DT.I32_5HD, DT.I32_5HD) \
    .dtype_format(DT.F16_FracZ, DT.F16_FracZ, DT.F16_FracZ, DT.F16_FracZ) \
    .dtype_format(DT.F32_FracZ, DT.F32_FracZ, DT.F32_FracZ, DT.F32_FracZ) \
    .dtype_format(DT.I32_FracZ, DT.I32_FracZ, DT.I32_FracZ, DT.I32_FracZ) \
    .get_op_info()


@op_info_register(op_info)
def _inplace_assign_akg():
    """InplaceAssign Akg register"""
    return
Esempio n. 16
0
#
# 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.

"""SqueezeGrad op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

squeeze_grad_op_info = AkgGpuRegOp("SqueezeGrad") \
    .fusion_type("OPAQUE") \
    .input(0, "y_grad") \
    .output(0, "output") \
    .attr("x_shape", "required", "listInt") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default) \
    .dtype_format(DataType.I32_Default, DataType.I32_Default) \
    .dtype_format(DataType.I16_Default, DataType.I16_Default) \
    .dtype_format(DataType.U8_Default, DataType.U8_Default) \
    .dtype_format(DataType.BOOL_Default, DataType.BOOL_Default) \
    .get_op_info()


@op_info_register(squeeze_grad_op_info)
def _squeeze_grad_akg():
    """SqueezeGrad AutoDiff register"""
    return
Esempio n. 17
0
# 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.
"""LogicalAnd op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

logicaland_op_info = AkgGpuRegOp("LogicalAnd") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .input(1, "y") \
    .output(0, "output") \
    .dtype_format(DataType.BOOL_Default, DataType.BOOL_Default, DataType.BOOL_Default) \
    .get_op_info()


@op_info_register(logicaland_op_info)
def _logical_and_akg():
    """LogicalAnd register"""
    return
Esempio n. 18
0
#
# 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.
"""Sub op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

sub_op_info = AkgGpuRegOp("Sub") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .input(1, "y") \
    .output(0, "output") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default, DataType.F16_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default, DataType.F32_Default) \
    .dtype_format(DataType.I32_Default, DataType.I32_Default, DataType.I32_Default) \
    .get_op_info()


@op_info_register(sub_op_info)
def _sub_akg():
    """Sub AutoDiff register"""
    return
Esempio n. 19
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.

"""GreaterEqual op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType

greater_equal_op_info = AkgGpuRegOp("GreaterEqual") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .input(1, "y") \
    .output(0, "output") \
    .dtype_format(DataType.F16_Default, DataType.F16_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.F32_Default, DataType.F32_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.F64_Default, DataType.F64_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I64_Default, DataType.I64_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I32_Default, DataType.I32_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I16_Default, DataType.I16_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.U8_Default, DataType.U8_Default, DataType.BOOL_Default) \
    .dtype_format(DataType.I8_Default, DataType.I8_Default, DataType.BOOL_Default) \
    .get_op_info()


@op_info_register(greater_equal_op_info)
def _greater_equal_akg():
    """GreaterEqual register"""
    return
Esempio n. 20
0
# 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.
# ============================================================================
"""ExpandDims op"""
from mindspore.ops.op_info_register import op_info_register, AkgGpuRegOp, DataType as DT

op_info = AkgGpuRegOp("ExpandDims") \
    .fusion_type("OPAQUE") \
    .input(0, "x") \
    .output(0, "output") \
    .attr("axis", "required", "int") \
    .dtype_format(DT.F16_Default, DT.F16_Default) \
    .dtype_format(DT.F32_Default, DT.F32_Default) \
    .dtype_format(DT.I32_Default, DT.I32_Default) \
    .get_op_info()


@op_info_register(op_info)
def _expand_dims_akg():
    """ExpandDims Akg register"""
    return