2 # Copyright (C) 2017 The Android Open Source Project
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
24 input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (batches, input_size))
25 weights_feature = Input("weights_feature", "TENSOR_FLOAT32", "{%d, %d}" % (units, input_size))
26 weights_time = Input("weights_time", "TENSOR_FLOAT32", "{%d, %d}" % (units, memory_size))
27 bias = Input("bias", "TENSOR_FLOAT32", "{%d}" % (units))
28 state_in = Input("state_in", "TENSOR_FLOAT32", "{%d, %d}" % (batches, memory_size*units))
29 rank_param = Int32Scalar("rank_param", 1)
30 activation_param = Int32Scalar("activation_param", 0)
31 state_out = Output("state_out", "TENSOR_FLOAT32", "{%d, %d}" % (batches, memory_size*units))
32 output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (batches, units))
34 model = model.Operation("SVDF", input, weights_feature, weights_time, bias, state_in,
35 rank_param, activation_param).To([state_out, output])
39 -0.31930989, -0.36118156, 0.0079667, 0.37613347,
40 0.22197971, 0.12416199, 0.27901134, 0.27557442,
41 0.3905206, -0.36137494, -0.06634006, -0.10640851
44 -0.31930989, 0.37613347, 0.27901134, -0.36137494, -0.36118156,
45 0.22197971, 0.27557442, -0.06634006, 0.0079667, 0.12416199,
47 0.3905206, -0.10640851, -0.0976817, 0.15294972, 0.39635518,
48 -0.02702999, 0.39296314, 0.15785322, 0.21931258, 0.31053296,
50 -0.36916667, 0.38031587, -0.21580373, 0.27072677, 0.23622236,
51 0.34936687, 0.18174365, 0.35907319, -0.17493086, 0.324846,
53 -0.10781813, 0.27201805, 0.14324132, -0.23681851, -0.27115166,
54 -0.01580888, -0.14943552, 0.15465137, 0.09784451, -0.0337657
60 0.14278367, -1.64410412, -0.75222826,
61 0.14278367, -1.64410412, -0.75222826,
91 0, -0.166701, -0.40465, 0,
96 0, 0.0805206, 0.137515, 0,
101 0, -0.166701, -0.40465, 0,
106 0, 0.0805206, 0.137515, 0,
109 0.068281, -0.162217, -0.152268, 0.00323521,
110 0.068281, -0.162217, -0.152268, 0.00323521,
114 Example((input0, output0))