1e690296739a1d93f4a81666865472c432cac5f90Miao Wang#
2e690296739a1d93f4a81666865472c432cac5f90Miao Wang# Copyright (C) 2018 The Android Open Source Project
3e690296739a1d93f4a81666865472c432cac5f90Miao Wang#
4e690296739a1d93f4a81666865472c432cac5f90Miao Wang# Licensed under the Apache License, Version 2.0 (the "License");
5e690296739a1d93f4a81666865472c432cac5f90Miao Wang# you may not use this file except in compliance with the License.
6e690296739a1d93f4a81666865472c432cac5f90Miao Wang# You may obtain a copy of the License at
7e690296739a1d93f4a81666865472c432cac5f90Miao Wang#
8e690296739a1d93f4a81666865472c432cac5f90Miao Wang#      http://www.apache.org/licenses/LICENSE-2.0
9e690296739a1d93f4a81666865472c432cac5f90Miao Wang#
10e690296739a1d93f4a81666865472c432cac5f90Miao Wang# Unless required by applicable law or agreed to in writing, software
11e690296739a1d93f4a81666865472c432cac5f90Miao Wang# distributed under the License is distributed on an "AS IS" BASIS,
12e690296739a1d93f4a81666865472c432cac5f90Miao Wang# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e690296739a1d93f4a81666865472c432cac5f90Miao Wang# See the License for the specific language governing permissions and
14e690296739a1d93f4a81666865472c432cac5f90Miao Wang# limitations under the License.
15e690296739a1d93f4a81666865472c432cac5f90Miao Wang#
16e690296739a1d93f4a81666865472c432cac5f90Miao Wang
17e690296739a1d93f4a81666865472c432cac5f90Miao Wang# model
18e690296739a1d93f4a81666865472c432cac5f90Miao Wangmodel = Model()
19e690296739a1d93f4a81666865472c432cac5f90Miao Wangi1 = Input("op1", "TENSOR_FLOAT32", "{1, 2, 2, 2}")
20e690296739a1d93f4a81666865472c432cac5f90Miao Wangi2 = Output("op2", "TENSOR_FLOAT32", "{1, 3, 3, 2}")
2103fde839dc0bfa4f2ead0d60fc4fe80f55e52660Michael Butlerh = Int32Scalar("height", 3) # an int32_t scalar bias
2203fde839dc0bfa4f2ead0d60fc4fe80f55e52660Michael Butlerw = Int32Scalar("width", 3)
23e690296739a1d93f4a81666865472c432cac5f90Miao Wangmodel = model.Operation("RESIZE_BILINEAR", i1, h, w).To(i2)
24e690296739a1d93f4a81666865472c432cac5f90Miao Wang
25e690296739a1d93f4a81666865472c432cac5f90Miao Wang# Example 1. Input in operand 0,
26e690296739a1d93f4a81666865472c432cac5f90Miao Wanginput0 = {i1: # input 0
27e690296739a1d93f4a81666865472c432cac5f90Miao Wang          [3, 4, 6, 10, 9, 10, 12, 16]}
28e690296739a1d93f4a81666865472c432cac5f90Miao Wangoutput0 = {i2: # output 0
29e690296739a1d93f4a81666865472c432cac5f90Miao Wang           [3, 4, 5, 8, 6, 10,
30e690296739a1d93f4a81666865472c432cac5f90Miao Wang            7, 8, 9, 12, 10, 14,
31e690296739a1d93f4a81666865472c432cac5f90Miao Wang            9, 10, 11, 14, 12, 16,]}
32e690296739a1d93f4a81666865472c432cac5f90Miao Wang
33e690296739a1d93f4a81666865472c432cac5f90Miao Wang# Instantiate an example
34e690296739a1d93f4a81666865472c432cac5f90Miao WangExample((input0, output0))
35