Commit f53c6c32 authored by Davis King's avatar Davis King

Fixed a bug in the extract layer that trigged when a tensor with a different

number of samples than the tensor used to initialize the network was passed
through the layer.
parent 9e67724d
......@@ -2916,6 +2916,12 @@ namespace dlib
template <typename SUBNET>
void forward(const SUBNET& sub, resizable_tensor& output)
{
if (aout.num_samples() != sub.get_output().num_samples())
{
aout = alias_tensor(sub.get_output().num_samples(), _k*_nr*_nc);
ain = alias_tensor(sub.get_output().num_samples(), sub.get_output().size()/sub.get_output().num_samples());
}
output.set_size(sub.get_output().num_samples(), _k, _nr, _nc);
auto out = aout(output,0);
auto in = ain(sub.get_output(),0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment