MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ conv1d_length()

uint32_t MayaFlux::Yantra::TensorKernels::conv1d_length ( const Conv1d & layer,
uint32_t t_in )
inlinenodiscard

Output length of a convolution, 0 when the window does not fit the padded input.

Parameters
layerThe layer. Kernel, stride and dilation must be at least 1.
t_inInput length.
Exceptions
std::invalid_argumentWhen kernel, stride or dilation is 0.

Definition at line 88 of file Layers.hpp.

89{
90 if (layer.kernel == 0 || layer.stride == 0 || layer.dilation == 0) {
91 detail::refuse("Conv1d needs a kernel, stride and dilation of at least 1");
92 }
93 const uint64_t span = static_cast<uint64_t>(layer.dilation) * (layer.kernel - 1U) + 1U;
94 const uint64_t padded = static_cast<uint64_t>(t_in) + 2ULL * layer.pad;
95 return padded < span ? 0U : static_cast<uint32_t>((padded - span) / layer.stride + 1U);
96}
void refuse(std::string_view message)
Definition Layers.hpp:74

References MayaFlux::Yantra::TensorKernels::Conv1d::dilation, MayaFlux::Yantra::TensorKernels::Conv1d::kernel, MayaFlux::Yantra::TensorKernels::Conv1d::pad, MayaFlux::Yantra::TensorKernels::detail::refuse(), and MayaFlux::Yantra::TensorKernels::Conv1d::stride.

Referenced by conv1d_stage(), and MayaFlux::Yantra::SileroVadModel::Impl::run().

Here is the call graph for this function:
Here is the caller graph for this function: