Add LogSoftmax-5 to ngraph (#2645)

This commit is contained in:
Maxim Vafin
2020-10-14 08:08:27 +03:00
committed by GitHub
parent 93c2d6db41
commit cf09752a29
14 changed files with 675 additions and 141 deletions

View File

@@ -0,0 +1,29 @@
# ******************************************************************************
# Copyright 2020 Intel Corporation
#
# 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.
# ******************************************************************************
import numpy as np
import ngraph as ng
from ngraph.impl import Shape, Type
def test_log_softmax():
float_dtype = np.float32
data = ng.parameter(Shape([3, 10]), dtype=float_dtype, name="data")
node = ng.log_softmax(data, 1)
assert node.get_type_name() == "LogSoftmax"
assert node.get_output_size() == 1
assert list(node.get_output_shape(0)) == [3, 10]
assert node.get_output_element_type(0) == Type.f32