Stack and streaming conformer support (#141)
* added csrc/stack.cc * stack: added checks * added copyright info * passed cpp style checks * formatted code * added some support for streaming conformer model support (not verified) * code lint * made more progress with streaming conformer support (not working yet) * passed style check * changes as suggested by @csukuangfj * added some debug info * fixed style check * Use Cat to replace Stack * remove debug statements --------- Co-authored-by: Jingzhao Ou (jou2019) <jou2019@cisco.com> Co-authored-by: Fangjun Kuang <csukuangfj@gmail.com>
This commit is contained in:
29
sherpa-onnx/csrc/stack.h
Normal file
29
sherpa-onnx/csrc/stack.h
Normal file
@@ -0,0 +1,29 @@
|
||||
// sherpa-onnx/csrc/stack.h
|
||||
//
|
||||
// Copyright (c) 2023 Jingzhao Ou (jingzhao.ou@gmail.com)
|
||||
|
||||
#ifndef SHERPA_ONNX_CSRC_STACK_H_
|
||||
#define SHERPA_ONNX_CSRC_STACK_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "onnxruntime_cxx_api.h" // NOLINT
|
||||
|
||||
namespace sherpa_onnx {
|
||||
|
||||
/** Stack a list of tensors along the given dim.
|
||||
*
|
||||
* @param allocator Allocator to allocate space for the returned tensor
|
||||
* @param values Pointer to a list of tensors. The shape of the tensor must
|
||||
* be the same except on the dim to be stacked.
|
||||
* @param dim The dim along which to concatenate the input tensors
|
||||
*
|
||||
* @return Return the stacked tensor
|
||||
*/
|
||||
template <typename T = float>
|
||||
Ort::Value Stack(OrtAllocator *allocator,
|
||||
const std::vector<const Ort::Value *> &values, int32_t dim);
|
||||
|
||||
} // namespace sherpa_onnx
|
||||
|
||||
#endif // SHERPA_ONNX_CSRC_STACK_H_
|
||||
Reference in New Issue
Block a user