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

◆ grouped_conv1d_length()

uint32_t MayaFlux::Yantra::TensorKernels::grouped_conv1d_length ( const GroupedConv1d & layer,
uint32_t t_in )
inlinenodiscard

Output length of a grouped convolution after its trim, 0 when nothing is left.

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

Definition at line 104 of file Layers.hpp.

105{
106 if (layer.kernel == 0 || layer.stride == 0 || layer.groups == 0) {
107 detail::refuse("Grouped Conv1d needs a kernel, stride and groups of at least 1");
108 }
109 const uint64_t padded = static_cast<uint64_t>(t_in) + 2ULL * layer.pad;
110 if (padded < layer.kernel) {
111 return 0U;
112 }
113 const uint64_t full = (padded - layer.kernel) / layer.stride + 1U;
114 return full > layer.trim ? static_cast<uint32_t>(full - layer.trim) : 0U;
115}
void refuse(std::string_view message)
Definition Layers.hpp:74

References MayaFlux::Yantra::TensorKernels::GroupedConv1d::groups, MayaFlux::Yantra::TensorKernels::GroupedConv1d::kernel, MayaFlux::Yantra::TensorKernels::GroupedConv1d::pad, MayaFlux::Yantra::TensorKernels::detail::refuse(), MayaFlux::Yantra::TensorKernels::GroupedConv1d::stride, and MayaFlux::Yantra::TensorKernels::GroupedConv1d::trim.

Referenced by grouped_conv1d_stage().

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