def template():
    template_test_unary_operator(LocalResponseNormalization, {
        "n": 1,
        "k": 2,
        "alpha": 0.1,
        "beta": 0.2
    },
                                 test1d=False,
                                 test2d=False,
                                 test3d=False,
                                 test4d=True,
                                 axes=[Axis.N, Axis.H, Axis.W, Axis.C])
示例#2
0
def template(ksize=3, stride=1, pad=1, height=2, width=3, expected_dict=None):
    template_test_unary_operator(
        AveragePooling2D, {
            "ksize": ksize,
            "stride": stride,
            "padding": pad
        },
        test1d=False,
        test2d=False,
        test3d=False,
        test4d=True,
        axes=[Axis.N, Axis.H, Axis.W, Axis.C],
        shape_dict=AxisKeyDict([Axis.N, Axis.H, Axis.W, Axis.C],
                               [2, height, width, 4]),
        expected_dict=expected_dict)
示例#3
0
def template(ksize=3, stride=1, pad=1, height=2, width=3, expected_dict=None):
    template_test_unary_operator(MaxPooling2D, {
        "ksize": ksize,
        "stride": stride,
        "padding": pad
    },
                                 test1d=False,
                                 test2d=False,
                                 test3d=False,
                                 test4d=True,
                                 axes=[Axis.N, Axis.H, Axis.W, Axis.C],
                                 shape_dict={
                                     Axis.N: 2,
                                     Axis.H: height,
                                     Axis.W: width,
                                     Axis.C: 4
                                 },
                                 expected_dict=expected_dict)
示例#4
0
def template():
    template_test_unary_operator(Softmax, {"axis": Axis.C},
                                 test1d=False,
                                 test2d=True,
                                 test3d=False,
                                 test4d=False,
                                 axes=[Axis.N, Axis.C])
    template_test_unary_operator(Softmax, {"axis": Axis.C},
                                 test1d=False,
                                 test2d=False,
                                 test3d=True,
                                 test4d=False,
                                 axes=[Axis.N, Axis.C, Axis.T])
    template_test_unary_operator(Softmax, {"axis": Axis.C},
                                 test1d=False,
                                 test2d=False,
                                 test3d=False,
                                 test4d=True,
                                 axes=[Axis.N, Axis.C, Axis.H, Axis.W])
示例#5
0
def template():
    template_test_unary_operator(Elu)
示例#6
0
def template():
    template_test_unary_operator(Sigmoid)
示例#7
0
def template():
    template_test_unary_operator(Tanh)
示例#8
0
def template():
    template_test_unary_operator(ScalarPow, {"value": 2})
示例#9
0
def template():
    template_test_unary_operator(ScalarAffine, {"scale": 2.0, "bias": 3.0})
示例#10
0
def template():
    template_test_unary_operator(LeakyRelu, {"slope": 0.3})
示例#11
0
def template():
    template_test_unary_operator(Softsign)
示例#12
0
def template():
    template_test_unary_operator(ClippedRelu, {"cap": 10.0})
示例#13
0
def template():
    template_test_unary_operator(Softplus, {"beta": 1.0})