1#
2# Copyright (C) 2018 The Android Open Source Project
3#
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
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15#
16
17# model
18model = Model()
19i1 = Input("op1", "TENSOR_FLOAT32", "{2, 3}") # input tensor 0
20i2 = Input("op2", "TENSOR_FLOAT32", "{2, 3}") # input tensor 1
21axis0 = Int32Scalar("axis0", 0)
22r = Output("result", "TENSOR_FLOAT32", "{4, 3}") # output
23model = model.Operation("CONCATENATION", i1, i2, axis0).To(r)
24model = model.RelaxedExecution(True)
25
26# Example 1.
27input0 = {i1: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
28          i2: [7.0, 8.0, 9.0, 10.0, 11.0, 12.0]}
29output0 = {r: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0]}
30
31# Instantiate an example
32Example((input0, output0))
33