summaryrefslogtreecommitdiff
path: root/tests/nnapi/specs/V1_0/local_response_norm_float_1.mod.py
blob: 99bb59b5693e7fdb32eda3a6c7d586bbca11b7b9 (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", 9.)
alpha = Float32Scalar("alpha", 4.)
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
           [-.22, .12, .14, .24, -.14, .02]}

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