diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index b478ce7ed5d96173e1913fab44d8a1470155b71d..3c3c7c63bf0c60e3e7d310368c775b6ae1a9f854 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -94,6 +94,7 @@ using TypeSadl = float;
 #if NN_FILTERING_SET_1
 #define SCALE_NN_RESIDUE                                  1
 #define COMBINE_NN_WITH_LF                                1
+#define BYPASS_INTER_SLICE                                0 // only used for training data generation
 #endif
 
 #if SCALE_NN_RESIDUE
diff --git a/source/Lib/EncoderLib/EncNNFilterSet1.cpp b/source/Lib/EncoderLib/EncNNFilterSet1.cpp
index d335c6cbc4e91ea3ee4a0f770a3bd7f593b63124..002858b7618b3e84f388d8dabd33a5af51923fc1 100644
--- a/source/Lib/EncoderLib/EncNNFilterSet1.cpp
+++ b/source/Lib/EncoderLib/EncNNFilterSet1.cpp
@@ -301,6 +301,22 @@ void EncNNFilterSet1::cnnFilterEncoder(Picture *pic, const double *lambdas)
   
   int numParams = cs.sps->getNnlfSet1MaxNumParams();
   
+#if BYPASS_INTER_SLICE
+  if (pcSlice->getSliceType() != I_SLICE)
+  {
+    for (int chal = 0; chal < numValidChannels; chal++)
+    {
+      const ChannelType chType = ChannelType( chal );
+      pcSlice->setNnlfSet1Mode(chType, 0);
+      for (int paramIdx = 0; paramIdx < numParams; paramIdx ++)
+      {
+        pcSlice->setNnScaleFlag(false, paramIdx, chType);
+      }
+    }
+    return;
+  }
+#endif
+  
   cnnFilterPicture(pic, numParams);
 
   double minCost[2]       = {MAX_DOUBLE, MAX_DOUBLE};