summaryrefslogtreecommitdiff
path: root/runtimes/tests/neural_networks_test/specs/V1_0/softmax_quant8_2.mod.py
blob: e4caa0055c1eb1a39136fc42db544212c5e51b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# model
model = Model()

i1 = Input("input", "TENSOR_QUANT8_ASYMM", "{2, 5}, 0.5f, 0") # batch = 2, depth = 5
beta = Float32Scalar("beta", 1.)
output = Output("output", "TENSOR_QUANT8_ASYMM", "{2, 5}, 0.00390625f, 0")

# model 1
model = model.Operation("SOFTMAX", i1, beta).To(output)

# Example 1. Input in operand 0,
input0 = {i1:
          [1, 2, 3, 4, 5,
           255, 254, 253, 252, 251]}

output0 = {output:
           [15, 24, 40, 67, 110,
            110, 67, 40, 24, 15]}

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