diff --git a/torch_modules/src/SplitTransModule.cpp b/torch_modules/src/SplitTransModule.cpp
index 4ddd818b596980a583bd6006087da49a02bd86a0..6fdf54d5908ef83303ba5026c8db3d71d52d2571 100644
--- a/torch_modules/src/SplitTransModule.cpp
+++ b/torch_modules/src/SplitTransModule.cpp
@@ -3,6 +3,7 @@
 
 SplitTransModuleImpl::SplitTransModuleImpl(int maxNbTrans, const std::string & definition)
 {
+  this->maxNbTrans = maxNbTrans;
   std::regex regex("(?:(?:\\s|\\t)*)(\\S+)\\{(.*)\\}(?:(?:\\s|\\t)*)In\\{(.*)\\}(?:(?:\\s|\\t)*)Out\\{(.*)\\}(?:(?:\\s|\\t)*)");
   if (!util::doIfNameMatch(regex, definition, [this,&definition](auto sm)
         {