Skip to content

Commit

Permalink
Remove empty statement (#5827)
Browse files Browse the repository at this point in the history
* Remove empty statement

* Remove empty statement
  • Loading branch information
feiyun0112 committed Jun 17, 2021
1 parent 6114b4f commit b3a3c66
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ IEnumerable<DataViewSchema.Column> ISchemaBoundRowMapper.GetDependenciesForNewCo
if (!InputRoleMappedSchema.Feature.HasValue || dependingColumns.Count() == 0)
return Enumerable.Empty<DataViewSchema.Column>();

return Enumerable.Repeat(InputRoleMappedSchema.Feature.Value, 1); ;
return Enumerable.Repeat(InputRoleMappedSchema.Feature.Value, 1);
}

public IEnumerable<KeyValuePair<RoleMappedSchema.ColumnRole, string>> GetInputColumnRoles()
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private static bool GetHiddenOption(IHostEnvironment env, HiddenColumnOption opt
return false;
default:
throw env.Except("Unsupported hide option specified");
};
}
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/Hashing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ private static IDataTransform Create(IHostEnvironment env, Options options, IDat
item.Seed ?? options.Seed,
item.Ordered ?? options.Ordered,
item.MaximumNumberOfInverts ?? options.MaximumNumberOfInverts);
};
}
return new HashingTransformer(env, input, cols).MakeDataTransform(input);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/KeyToVector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private static IDataTransform Create(IHostEnvironment env, Options options, IDat
item.Name,
item.Source ?? item.Name,
item.Bag ?? options.Bag);
};
}
return new KeyToVectorMappingTransformer(env, cols).MakeDataTransform(input);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/TypeConverting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
kind = tempResultType.Value;
}
cols[i] = new TypeConvertingEstimator.ColumnOptions(item.Name, kind.ToDataKind(), item.Source ?? item.Name, keyCount);
};
}
return new TypeConvertingTransformer(env, cols).MakeDataTransform(input);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
item.TextKeyValues ?? options.TextKeyValues);
cols[i].Keys = item.Terms;
cols[i].Key = item.Term ?? options.Term;
};
}
var keyData = GetKeyDataViewOrNull(env, ch, options.DataFile, options.TermsColumn, options.Loader, out bool autoLoaded);
return new ValueToKeyMappingTransformer(env, input, cols, keyData, autoLoaded).MakeDataTransform(input);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ internal static class PermutationFeatureImportanceUtils
TopKAccuracyStdErr = pMetric.TopKAccuracy.StandardError,
PerClassLogLoss = pMetric.PerClassLogLoss.Select(x => x.Mean).ToArray(),
PerClassLogLossStdErr = pMetric.PerClassLogLoss.Select(x => x.StandardError).ToArray()
}); ;
});
}

// Convert unknown size vectors to known size.
Expand Down Expand Up @@ -314,7 +314,7 @@ private static string[] GetSlotNames(RoleMappedSchema schema)
foreach (var value in slotValues)
{
slotNames.Add(value.ToString());
};
}

return slotNames.ToArray();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.FastTree/Utils/LinqExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static T[] ToArray<T>(this IEnumerable<T> me, int length)
public static IEnumerable<int> CumulativeSum<T>(this IEnumerable<int> s)
{
int sum = 0;
;

foreach (var x in s)
{
sum = sum + x;
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Featurizers/TimeSeriesImputerDataView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ private sealed class Cursor : DataViewRowCursor

var sharedState = new SharedColumnState();

_allColumns = _schema.Select(x => TypedColumn.CreateTypedColumn(x, dataColumns, allImputedColumnNames, sharedState)).ToDictionary(x => x.Column.Name); ;
_allColumns = _schema.Select(x => TypedColumn.CreateTypedColumn(x, dataColumns, allImputedColumnNames, sharedState)).ToDictionary(x => x.Column.Name);
_allColumns[IsRowImputedColumnName] = new BoolTypedColumn(_schema[IsRowImputedColumnName], false, true, sharedState);

foreach (var column in _allColumns.Values)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.LightGbm/LightGbmTrainerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ private void GetFeatureValueDense(IChannel ch, FloatLabelCursor cursor, Categori
nonZeroCntPerColumn[i] = 0;
sampleValuePerColumn[i] = new double[estimateNonZeroCnt];
sampleIndicesPerColumn[i] = new int[estimateNonZeroCnt];
};
}
using (var cursor = factory.Create())
{
int step = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.ML.LightGbm/WrappedLightGbmDataset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal sealed class Dataset : IDisposable
ptrArrayValues[i] = (double*)gcValues[i].AddrOfPinnedObject().ToPointer();
gcIndices[i] = GCHandle.Alloc(sampleIndicesPerColumn[i], GCHandleType.Pinned);
ptrArrayIndices[i] = (int*)gcIndices[i].AddrOfPinnedObject().ToPointer();
};
}
fixed (double** ptrValues = ptrArrayValues)
fixed (int** ptrIndices = ptrArrayIndices)
{
Expand All @@ -79,7 +79,7 @@ internal sealed class Dataset : IDisposable
gcValues[i].Free();
if (gcIndices[i].IsAllocated)
gcIndices[i].Free();
};
}
}
// Before adding examples (i.e., feature vectors of the original data set), the original labels, weights, and groups are added.
SetLabel(labels);
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private static bool CheckOnnxShapeCompatibility(IEnumerable<int> left, IEnumerab
// Along a specific axis, if any of left or right have unknown dimension, the overwriting can happen.
if (l != r && l > 0 && r > 0)
return false;
};
}
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Parquet/PartitionedPathParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void ICanSaveModel.Save(ModelSaveContext ctx)
sb.Clear();
_host.Check(col.TryUnparse(sb));
ctx.SaveString(sb.ToString());
};
}
}
public IEnumerable<PartitionedFileLoader.Column> ParseColumns(string path)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.StandardTrainers/Standard/SdcaBinary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ private protected override SchemaShape.Column[] ComputeSdcaBinaryClassifierSchem
NumberDataViewType.Single,
false,
new SchemaShape(AnnotationUtils.GetTrainerOutputAnnotation(true))));
};
}

return outCols.ToArray();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Transforms/KeyToVectorMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private static IDataTransform Create(IHostEnvironment env, Options options, IDat
{
var item = options.Columns[i];
cols[i] = (item.Name, item.Source ?? item.Name);
};
}
}
return new KeyToBinaryVectorMappingTransformer(env, cols).MakeDataTransform(input);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Transforms/MissingValueReplacing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
(MissingValueReplacingEstimator.ReplacementMode)(item.Kind ?? options.ReplacementKind),
item.Slot ?? options.ImputeBySlot,
item.ReplacementString);
};
}
return new MissingValueReplacingTransformer(env, input, cols).MakeDataTransform(input);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Transforms/RandomFourierFeaturizing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private static IDataTransform Create(IHostEnvironment env, Options options, IDat
item.Source ?? item.Name,
(item.MatrixGenerator ?? options.MatrixGenerator).CreateComponent(env),
item.Seed ?? options.Seed);
};
}
}
return new ApproximatedKernelTransformer(env, input, cols).MakeDataTransform(input);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private static IDataTransform Create(IHostEnvironment env, Options options, IDat
item.MaximumNumberOfInverts ?? options.MaximumNumberOfInverts,
item.RehashUnigrams ?? options.RehashUnigrams
);
};
}
}
return new NgramHashingTransformer(env, input, cols).MakeDataTransform(input);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Transforms/Text/NgramTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
item.Weighting ?? options.Weighting,
maxNumTerms,
item.Source ?? item.Name);
};
}
}
return new NgramExtractingTransformer(env, input, cols).MakeDataTransform(input);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Transforms/Text/TokenizingByCharacters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private void SaveAsOnnxCore(OnnxContext ctx, int iinfo, string srcVariableName,
node = ctx.CreateNode(opType, squeezeOutput, labelEncoderOutput, ctx.GetNodeName(opType));

IEnumerable<string> charStrings = Enumerable.Range(0, 65535).Select(x => ((char)x).ToString());
IEnumerable<long> charValues = Enumerable.Range(0, 65535).Select(x => Convert.ToInt64(x)); ;
IEnumerable<long> charValues = Enumerable.Range(0, 65535).Select(x => Convert.ToInt64(x));
node.AddAttribute("keys_strings", charStrings);
node.AddAttribute("values_int64s", charValues);

Expand Down

0 comments on commit b3a3c66

Please sign in to comment.