summaryrefslogtreecommitdiff
path: root/tests/nnapi/specs/V1_0/local_response_norm_float_2.mod.py
blob: fa025bfc06833505b291a243c03ef68dd02b6215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
model = Model()
i1 = Input("input", "TENSOR_FLOAT32", "{1, 1, 1, 6}")
radius = Int32Scalar("radius", 20)
bias = Float32Scalar("bias", 0.)
alpha = Float32Scalar("alpha", 1.)
beta = Float32Scalar("beta", .5)
output = Output("output", "TENSOR_FLOAT32", "{1, 1, 1, 6}")

model = model.Operation("LOCAL_RESPONSE_NORMALIZATION", i1, radius, bias, alpha, beta).To(output)

# Example 1. Input in operand 0,
input0 = {i1: # input 0
          [-1.1, .6, .7, 1.2, -.7, .1]}

output0 = {output: # output 0
           [-.55, .3, .35, .6, -.35, .05]}

# Instantiate an example
Example((input0, output0))