# Copyright (c) 2021, NVIDIA CORPORATION.  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.

name: "decoder"
backend: "onnxruntime"
default_model_filename: "decoder.onnx"

max_batch_size: 640
input [
  {
    name: "encoder_out"
    data_type: TYPE_#DTYPE
    dims: [-1, #output_size] # [-1, feature_size]
  },
  {
    name: "encoder_out_lens"
    data_type: TYPE_INT32
    dims: [1]
    reshape: { shape: [ ] }
  },
  {
    name: "hyps_pad_sos_eos"
    data_type: TYPE_INT64
    dims: [#beam_size, -1]
  },
 {
    name: "hyps_lens_sos"
    data_type: TYPE_INT32
    dims: [#beam_size]
  },
  {
    name: "ctc_score"
    data_type: TYPE_#DTYPE
    dims: [#beam_size]
  }
]

output [
   {
    name: "best_index"
    data_type: TYPE_INT64
    dims: [1]
    reshape: { shape: [ ] }
  }
]

dynamic_batching {
    preferred_batch_size: [ 16, 32 ]
  }

instance_group [
    {
      count: 2
      kind: KIND_GPU
    }
]

