summaryrefslogtreecommitdiff
path: root/tests/nnapi/specs/V1_0/softmax_float_1.mod.py
blob: 9f62bad9651bde9e21bc9e25222c73e1f195984a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# model
model = Model()

i1 = Input("input", "TENSOR_FLOAT32", "{1, 4}") # batch = 1, depth = 1
beta = Float32Scalar("beta", 0.000001)
output = Output("output", "TENSOR_FLOAT32", "{1, 4}")

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

# Example 1. Input in operand 0,
input0 = {i1: [1., 2., 10., 20.]}

output0 = {output: [.25, .25, .25, .25]}

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