33// See the LICENSE file in the project root for more information.
44
55using System ;
6- using System . Collections . Generic ;
76using System . Linq ;
87using System . Runtime . InteropServices ;
98using System . Security ;
@@ -620,12 +619,13 @@ protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, b
620619 } ;
621620 return del ;
622621 }
622+
623623 public bool CanSaveOnnx ( OnnxContext ctx ) => true ;
624624
625625 public void SaveAsOnnx ( OnnxContext ctx )
626626 {
627627 Host . CheckValue ( ctx , nameof ( ctx ) ) ;
628- int numColumns = _parent . ColumnPairs . Length ; //why are the multiple columns
628+ int numColumns = _parent . ColumnPairs . Length ;
629629 for ( int iinfo = 0 ; iinfo < numColumns ; ++ iinfo )
630630 {
631631 string inputColumnName = _parent . ColumnPairs [ iinfo ] . inputColumnName ;
@@ -637,8 +637,8 @@ public void SaveAsOnnx(OnnxContext ctx)
637637 string dstVariableName = ctx . AddIntermediateVariable ( _srcTypes [ iinfo ] , outputColumnName , true ) ;
638638 SaveAsOnnxCore ( ctx , iinfo , srcVariableName , dstVariableName ) ;
639639 }
640-
641640 }
641+
642642 private void SaveAsOnnxCore ( OnnxContext ctx , int iinfo , string srcVariableName , string dstVariableName )
643643 {
644644 var model = _parent . _models [ iinfo ] ;
@@ -658,18 +658,17 @@ private void SaveAsOnnxCore(OnnxContext ctx, int iinfo, string srcVariableName,
658658 {
659659 if ( i >= dimension )
660660 break ;
661- Array . Copy ( model , i * dimension , principalComponents , i * dimension , dimension ) ;
661+ Array . Copy ( model , i * dimension , principalComponents , i * dimension , dimension ) ;
662662 }
663663 model = principalComponents ;
664664 }
665665
666666 var opType = "Gemm" ;
667- var modelName = ctx . AddInitializer ( model , modelDimension , "model" ) ;
668- var zeroValueName = ctx . AddInitializer ( ( float ) 0 ) ;
667+ var modelName = ctx . AddInitializer ( model , modelDimension , "model" ) ;
668+ var zeroValueName = ctx . AddInitializer ( ( float ) 0 ) ;
669669
670670 var node = ctx . CreateNode ( opType , new [ ] { modelName , srcVariableName , zeroValueName } , new [ ] { dstVariableName } , ctx . GetNodeName ( opType ) , "" ) ;
671- node . AddAttribute ( "transB" , 1 ) ;
672-
671+ node . AddAttribute ( "transB" , 1 ) ;
673672 }
674673
675674 private ValueGetter < T > GetSrcGetter < T > ( DataViewRow input , int iinfo )
0 commit comments