"pipelines/deprecated/integration-test-adl.yml" did not exist on "496f653bc1129c7f3c225cd8e4c81900135c9001"
Softmax.py 774 Bytes
Newer Older
yaoht's avatar
yaoht committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import src.c2oObject as Node
##---------------------------------------------softmax层--------------------------------------------------------------##
#获取超参数
def getSoftmaxAttri(layer):
    ##轴
    axis = layer.softmax_param.axis
    #超参数字典
    dict = {"axis": axis}
    return dict
#计算输出维度
def getSoftmaxOutShape(input_shape):
    #计算输出维度output_shape
    output_shape = input_shape#与输入维度一样
    return output_shape
#构建节点
def createSoftmax(layer, nodename, inname, outname, input_shape):
    dict = getSoftmaxAttri(layer)
    output_shape = getSoftmaxOutShape(input_shape)
    #构建node
    node = Node.c2oNode(layer, nodename, "Softmax", inname, outname, input_shape, output_shape, dict)
    return node