summaryrefslogtreecommitdiff
path: root/runtimes/pure_arm_compute/src/internal/layers/SimpleTransposeConv.h
blob: c5519828bebe1aaaff3fc59832d7c784272cd1d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __TRANSPOSE_CONV_EX__
#define __TRANSPOSE_CONV_EX__

#include "internal/arm_compute.h"
#include "internal/arm_compute/Cast.h"

class SimpleTransposeConv : public ::arm_compute::IFunction
{
public:
  SimpleTransposeConv()
      : _input(nullptr), _weights(nullptr), _output(nullptr), _stride_width(0), _stride_height(0),
        _pad_width(0), _pad_height(0)
  {
    // DO NOTHING
  }

  /** Initialise input and output
   *
   * @param[in]  input              First tensor input.
   * @param[in]  weights            Weights
   * @param[out] output             Output tensor.
   * @param[in]  tc_info            Contains padding and policies to be used in the deconvolution,
   *                                this is decribed in @ref PadStrideInfo.
   * @param[in]  axises             Axises of rank 4
   */
  void configure(::arm_compute::ITensor *input, ::arm_compute::ITensor *weights,
                 ::arm_compute::ITensor *output, ::arm_compute::PadStrideInfo &tconv_info,
                 ::arm_compute::Coordinates axises = getARMComputeAxises(4));

  void run() override;

private:
  ::arm_compute::ITensor *_input;
  ::arm_compute::ITensor *_weights;
  ::arm_compute::ITensor *_output;
  int32_t _stride_width;
  int32_t _stride_height;
  int32_t _pad_width;
  int32_t _pad_height;
  ::arm_compute::Coordinates _axises;
};

#endif /*__TRANSPOSE_CONV_EX__ */