Browse Source

change hswish and hsigmoid accroding to primitive

tags/v0.2.0-alpha
chenzomi 5 years ago
parent
commit
c0229fa951
9 changed files with 29 additions and 25 deletions
  1. +4
    -4
      mindspore/_akg/gpu/__init__.py
  2. +4
    -4
      mindspore/_akg/gpu/hsigmoid.py
  3. +4
    -4
      mindspore/_akg/gpu/hsigmoid_grad.py
  4. +4
    -4
      mindspore/_akg/gpu/hswish.py
  5. +5
    -5
      mindspore/_akg/gpu/hswish_grad.py
  6. +2
    -2
      mindspore/ccsrc/predict/converter/lite_model/op_attr_packer.cc
  7. +1
    -1
      mindspore/nn/layer/activation.py
  8. +4
    -0
      mindspore/ops/_op_impl/akg/gpu/__init__.py
  9. +1
    -1
      mindspore/ops/operations/nn_ops.py

+ 4
- 4
mindspore/_akg/gpu/__init__.py View File

@@ -26,7 +26,7 @@ from .squeeze_grad import SqueezeGrad, gpu_schedule_SqueezeGrad
from .mean import SimpleMean, gpu_schedule_SimpleMean
from .mean_grad import SimpleMeanGrad, gpu_schedule_SimpleMeanGrad
from .mul import Mul, gpu_schedule_Mul
from .hsigmoid import Hsigmoid, gpu_schedule_Hsigmoid
from .hsigmoid_grad import HsigmoidGrad, gpu_schedule_HsigmoidGrad
from .hswish import Hswish, gpu_schedule_Hswish
from .hswish_grad import HswishGrad, gpu_schedule_HswishGrad
from .hsigmoid import HSigmoid, gpu_schedule_HSigmoid
from .hsigmoid_grad import HSigmoidGrad, gpu_schedule_HSigmoidGrad
from .hswish import HSwish, gpu_schedule_HSwish
from .hswish_grad import HSwishGrad, gpu_schedule_HSwishGrad

+ 4
- 4
mindspore/_akg/gpu/hsigmoid.py View File

@@ -33,9 +33,9 @@ def topi_nn_hsigmoid(x):
(x(*i) + 3) / 6)))


def Hsigmoid(x):
def HSigmoid(x):
"""
Hsigmoid
HSigmoid
Args:
x:

@@ -45,9 +45,9 @@ def Hsigmoid(x):
return topi_nn_hsigmoid(x)


def gpu_schedule_Hsigmoid(outs):
def gpu_schedule_HSigmoid(outs):
"""
gpu schedule Hsigmoid
gpu schedule HSigmoid
Args:
outs:



+ 4
- 4
mindspore/_akg/gpu/hsigmoid_grad.py View File

@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Hsigmoid grad"""
"""HSigmoid grad"""
import _akg.topi as topi
import _akg.tvm as tvm


def HsigmoidGrad(y_grad, x):
def HSigmoidGrad(y_grad, x):
"""
HsigmoidGrad
HSigmoidGrad
Args:
y_grad:
x:
@@ -32,7 +32,7 @@ def HsigmoidGrad(y_grad, x):
y_grad(*i) / 6)))


def gpu_schedule_HsigmoidGrad(outs):
def gpu_schedule_HSigmoidGrad(outs):
"""
gpu schedule ReLU6Grad
Args:


+ 4
- 4
mindspore/_akg/gpu/hswish.py View File

@@ -33,9 +33,9 @@ def topi_nn_hswish(x):
x(*i) * (x(*i) + 3) / 6)))


def Hswish(x):
def HSwish(x):
"""
Hswish
HSwish
Args:
x:

@@ -45,9 +45,9 @@ def Hswish(x):
return topi_nn_hswish(x)


def gpu_schedule_Hswish(outs):
def gpu_schedule_HSwish(outs):
"""
gpu schedule Hswish
gpu schedule HSwish
Args:
outs:



+ 5
- 5
mindspore/_akg/gpu/hswish_grad.py View File

@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""HswishGrad"""
"""HSwishGrad"""
import _akg.topi as topi
import _akg.tvm as tvm


def HswishGrad(y_grad, x):
def HSwishGrad(y_grad, x):
"""
HswishGrad
HSwishGrad
Args:
y_grad:
x:
@@ -34,9 +34,9 @@ def HswishGrad(y_grad, x):
return res6


def gpu_schedule_HswishGrad(outs):
def gpu_schedule_HSwishGrad(outs):
"""
gpu schedule HswishGrad
gpu schedule HSwishGrad
Args:
outs:



+ 2
- 2
mindspore/ccsrc/predict/converter/lite_model/op_attr_packer.cc View File

@@ -48,8 +48,8 @@ OpAttrFactory::OpAttrFactory() {
{"Softsign", ActivationPacker},
{"Softplus", ActivationPacker},
{"Tanh", ActivationPacker},
{"Hswish", ActivationPacker},
{"Hsigmoid", ActivationPacker},
{"HSwish", ActivationPacker},
{"HSigmoid", ActivationPacker},
{"MaxPool", PoolingPacker},
{"MaxPool2D", PoolingPacker},
{"MeanPool", PoolingPacker},


+ 1
- 1
mindspore/nn/layer/activation.py View File

@@ -346,7 +346,7 @@ class HSwish(Cell):
where :math:`x_{i}` is the :math:`i`-th slice along the given dim of the input Tensor.

Inputs:
- **input_data** (Tensor) - The input of Hswish.
- **input_data** (Tensor) - The input of HSwish.

Outputs:
Tensor, with the same type and shape as the `input_data`.


+ 4
- 0
mindspore/ops/_op_impl/akg/gpu/__init__.py View File

@@ -23,3 +23,7 @@ from .relu6_grad import _relu6_grad_akg
from .squeeze import _squeeze_akg
from .squeeze_grad import _squeeze_grad_akg
from .tile import _tile_akg
from .hsigmoid import _hsigmoid_akg
from .hsigmoid_grad import _hsigmoid_grad_akg
from .hswish import _hswish_akg
from .hswish_grad import _hswish_grad_akg

+ 1
- 1
mindspore/ops/operations/nn_ops.py View File

@@ -258,7 +258,7 @@ class HSwish(PrimitiveWithInfer):
where :math:`x_{i}` is the :math:`i`-th slice along the given dim of the input Tensor.

Inputs:
- **input_data** (Tensor) - The input of Hswish.
- **input_data** (Tensor) - The input of HSwish.

Outputs:
Tensor, with the same type and shape as the `input_data`.


Loading…
Cancel
Save