Add non-streaming ASR (#92)

This commit is contained in:
Fangjun Kuang
2023-03-26 08:53:42 +08:00
committed by GitHub
parent 6f92bc7362
commit 5572246253
48 changed files with 1526 additions and 150 deletions

View File

@@ -8,12 +8,12 @@
namespace sherpa_onnx {
/** Get a deep copy by slicing v.
/** Get a deep copy by slicing a 3-D tensor v.
*
* It returns v[dim0_start:dim0_end, dim1_start:dim1_end]
* It returns v[dim0_start:dim0_end, dim1_start:dim1_end, :]
*
* @param allocator
* @param v A 3-D tensor. Its data type is T.
* @param v A 2-D tensor. Its data type is T.
* @param dim0_start Start index of the first dimension..
* @param dim0_end End index of the first dimension..
* @param dim1_start Start index of the second dimension.
@@ -26,6 +26,23 @@ template <typename T = float>
Ort::Value Slice(OrtAllocator *allocator, const Ort::Value *v,
int32_t dim0_start, int32_t dim0_end, int32_t dim1_start,
int32_t dim1_end);
/** Get a deep copy by slicing a 2-D tensor v.
*
* It returns v[dim0_start:dim0_end, :]
*
* @param allocator
* @param v A 2-D tensor. Its data type is T.
* @param dim0_start Start index of the first dimension..
* @param dim0_end End index of the first dimension..
*
* @return Return a 2-D tensor of shape
* (dim0_end-dim0_start, v.shape[1])
*/
template <typename T = float>
Ort::Value Slice(OrtAllocator *allocator, const Ort::Value *v,
int32_t dim0_start, int32_t dim0_end);
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_SLICE_H_