In TransformerEncoder::TransformerEncoder func present code like
for (size_t l = 0;; ++l) {
const std::string layer_scope = scope + "/layer_" + std::to_string(l);
try {
auto layer = std::make_unique<TransformerEncoderLayer>(model,
layer_scope,
num_heads,
pre_norm,
activation_type);
_layers.emplace_back(std::move(layer));
} catch (std::exception&) {
if (l == 0)
throw;
else
break;
}
}
look like hardcoded hack, can anyone explane to me what is this exception catch processing, and what can i do for decrease or forget about this exceptions calls
exception view
Exception thrown at 0x00007FFD5D134F69 in test.exe: Microsoft C++ exception: std::out_of_range at memory location 0x0000004F2BEFD8E0.
thx.