129 references to Utils
Microsoft.ML.Core (121)
CommandLine\CharCursor.cs (3)
27_ichLim = Utils.Size(text); 35Contracts.CheckParam(0 <= min && min <= Utils.Size(text), nameof(min)); 36Contracts.CheckParam(min <= lim && lim <= Utils.Size(text), nameof(lim));
CommandLine\CmdParser.cs (12)
1259Arg[] args = Utils.BuildArray(argumentInfo.Args.Length, i => new Arg(argumentInfo.Args[i])); 1272Contracts.Assert(Utils.Size(genArgs) == 1); 1441Contracts.Assert(!IsDefault || Utils.Size(ShortNames) == 0); 1524for (int i = 0; i < Utils.Size(values);) 1542if (Utils.Size(values) > 0) 1570for (int i = 0; i < Utils.Size(values);) 1606for (int i = 0; i < Utils.Size(values);) 1636var res = Array.CreateInstance(ItemType, Utils.Size(values)); 1646var res = Array.CreateInstance(ItemType, Utils.Size(values)); 1712Utils.Add(ref val.Values, new KeyValuePair<string, object>("", newValue)); 1728return Utils.Size(ShortNames) != 0 ? ShortNames[0] : LongName; 2160if (Utils.Size(ShortNames) != 0)
ComponentModel\AssemblyLoadingUtils.cs (1)
25if (Utils.Size(assemblies) > 0)
ComponentModel\ComponentCatalog.cs (8)
209Contracts.Assert(getter == null || Utils.Size(attr.CtorTypes) == 0); 236Contracts.Assert(Utils.Size(ctorArgs) == CtorTypes.Length + ((RequireEnvironment) ? 1 : 0)); 241Contracts.Assert(Utils.Size(ctorArgs) == 0); 269env.Check(Utils.Size(extra) == ExtraArgCount); 276var values = Utils.Concat(prefix.ToArray(), extra); 467var parmTypesWithEnv = Utils.Concat(new Type[1] { typeof(IHostEnvironment) }, parmTypes); 469if (Utils.Size(parmTypes) == 0 && (getter = FindInstanceGetter(instType, loaderType)) != null) 1015int carg = Utils.Size(extra);
ComponentModel\LoadableClassAttribute.cs (1)
168if (Utils.Size(loadNames) == 0)
Data\ModelHeader.cs (3)
307Contracts.Check(Utils.Size(bytes) >= Size); 374Contracts.Check(Utils.Size(bytes) >= Size); 643Contracts.Check(Utils.Size(modelSignature) == 8, "Model signature must be eight characters");
Data\ModelLoadContext.cs (3)
141_ectx.CheckDecode(-1 <= id && id < Utils.Size(Strings)); 153Contracts.CheckDecode(0 <= id && id < Utils.Size(Strings)); 164_ectx.CheckDecode(0 <= id && id < Utils.Size(Strings));
Data\ModelLoading.cs (1)
296return Utils.Concat(args1, args2);
Data\ModelSaveContext.cs (1)
164using (var writer = Utils.OpenWriter(ent.Stream))
Data\ProgressReporter.cs (1)
77int n = Utils.Size(values);
Data\Repository.cs (2)
262_ectx.Check(Utils.Size(pathEnt) > 0); 298using (var writer = Utils.OpenWriter(ent.Stream))
Data\RoleMappedSchema.cs (4)
166Contracts.Assert(Utils.Size(kvp.Value) > 0); 306if (Utils.Size(infos) != 1) 307throw Contracts.Except("Expected exactly one column with role '{0}', but found {1}.", role.Value, Utils.Size(infos)); 316Contracts.Assert(Utils.Size(kvp.Value) > 0);
EntryPoints\EntryPointUtils.cs (1)
44return Utils.MarshalInvoke(_isValueWithinRangeMethodInfo, range.Type, range, val);
Utilities\BigArray.cs (20)
14/// <see cref="Utils.ArrayMaxSize"/> many entries, up to 0x7FEFFFFF00000L. 35private const long MaxSize = (long)Utils.ArrayMaxSize << BlockSizeBits; 104Contracts.Assert(longBlockCount <= Utils.ArrayMaxSize); 226Contracts.Assert(0 < longBlockCount && longBlockCount <= Utils.ArrayMaxSize); 244int curLastBlockSize = Utils.Size(_entries[curBlockCount - 1]); 296Contracts.Assert(Utils.Size(_entries) == 0); 304Contracts.Assert(0 < miLim && miLim <= Utils.Size(_entries[maMax])); 305if (Utils.Size(_entries[maMax]) != miLim) 332Utils.EnsureSize(ref _entries, maMax + 1, BlockSize); 338Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); 344Utils.EnsureSize(ref _entries[maMin], BlockSize, BlockSize); 348Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); 356Utils.EnsureSize(ref _entries[maMin], BlockSize, BlockSize); 371Utils.EnsureSize(ref _entries[maMax], maMax >= FullAllocationBeyond ? BlockSize : miLim, BlockSize); 407Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); 413Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); 415Contracts.Assert(miLim <= Utils.Size(_entries[maMax])); 423Contracts.Assert(BlockSize <= Utils.Size(_entries[maMin])); 429Contracts.Assert(BlockSize <= Utils.Size(_entries[major])); 436Contracts.Assert(miLim <= Utils.Size(_entries[maMax]));
Utilities\BinFinder.cs (10)
38if (Utils.Size(_path) < CountBins + 1) 43if (Utils.Size(_valuesSng) < numValues) 116if (Utils.Size(_path) < CountBins + 1) 121if (Utils.Size(_valuesDbl) < numValues) 337if (Utils.Size(_accum) < CountValues + 1) 393int split = Utils.FindIndexSorted(_accum, min, max, key); 575if (Utils.Size(_accum) < CountValues + 1) 586if (Utils.Size(_energies) < sizeEnergy) 592if (Utils.Size(_pathInfo) < sizeInfo) 594if (Utils.Size(_cols) < width)
Utilities\FixedSizeQueue.cs (1)
33Contracts.Assert(Utils.Size(_array) >= 0);
Utilities\FloatUtils.cs (4)
100int cbitShift = Utils.CbitHighZero(man) - CbitExp; 203Bits &= ~Utils.UuMaskBelow(-exp); 293int cbitShift = Utils.CbitHighZero(man) - CbitExp; 396Bits &= ~Utils.UMaskBelow(-exp);
Utilities\HashArray.cs (6)
65Contracts.Assert(0 <= _ct && _ct <= Utils.Size(_entries)); 69Contracts.Assert(Utils.Size(_rgit) >= _ct || Utils.Size(_rgit) == HashHelpers.MaxPrimeArrayLength); 153if (_ct >= Utils.Size(_entries)) 155Contracts.Assert(_ct == Utils.Size(_entries)); 156Utils.EnsureSize(ref _entries, _ct + 1);
Utilities\Hashing.cs (4)
59return Utils.GetLo(uu) + Utils.GetHi(uu); 277Contracts.Assert(0 <= ichMin && ichMin <= ichLim && ichLim <= Utils.Size(data)); 346Contracts.Check(lim <= Utils.Size(data));
Utilities\HybridMemoryStream.cs (4)
52if (!(0 <= maxLen && maxLen <= Utils.ArrayMaxSize)) 53throw Contracts.ExceptParam(nameof(maxLen), "must be in range [0,{0}]", Utils.ArrayMaxSize); 72if (!(0 <= maxLen && maxLen <= Utils.ArrayMaxSize)) 73throw Contracts.ExceptParam(nameof(maxLen), "must be in range [0,{0}]", Utils.ArrayMaxSize);
Utilities\MathUtils.cs (1)
706Contracts.Assert(Utils.Size(src) >= count);
Utilities\NormStr.cs (12)
74Contracts.Assert(Utils.IsPowerOfTwo(_mask + 1)); 76Contracts.Assert(0 <= _cns && _cns <= Utils.Size(_rgns)); 77Contracts.Assert(Utils.Size(_rgns) == Utils.Size(_rgmeta)); 106if ((int)Utils.GetLo(meta) == str.Length) 112ins = (int)Utils.GetHi(meta); 129if ((int)Utils.GetLo(meta) == str.Length) 135ins = (int)Utils.GetHi(meta); 182if ((int)Utils.GetLo(meta) == cch) 194ins = (int)Utils.GetHi(meta); 235_rgmeta[_cns] = Utils.MakeUlong((uint)_rgins[iins], (uint)ns.Value.Length); 272_rgmeta[ins] = Utils.MakeUlong((uint)_rgins[iins], (uint)ns.Value.Length);
Utilities\PathUtils.cs (1)
28string path = typeof(Utils).Assembly.Location;
Utilities\ResourceManagerUtils.cs (3)
204var envDir = Environment.GetEnvironmentVariable(Utils.CustomSearchDirEnvVariable); 225$"'{Utils.CustomSearchDirEnvVariable}' environment variable to a writable folder"; 243$"'{Utils.CustomSearchDirEnvVariable}' environment variable to a writable folder";
Utilities\Stream.cs (3)
149Contracts.Assert(0 <= count && count <= Utils.Size(values)); 162Contracts.Assert(0 <= count && count <= Utils.Size(values)); 272var numBits = Utils.Size(arr);
Utilities\SupervisedBinFinder.cs (2)
107Contracts.Assert(Utils.Size(boundaries) > 0); 185Contracts.Assert(Utils.Size(boundaries) > 0);
Utilities\Utils.cs (5)
601if (Utils.Size(values) <= 1) 627if (Utils.Size(values) <= 1) 653if (Utils.Size(values) <= 1) 904int cv = Utils.Size(a); 925return EnsureSize(ref array, min, Utils.ArrayMaxSize, keepOld);
Utilities\VBufferUtils.cs (4)
317if (dstValuesCount > 0 && Utils.TryFindIndexSorted(editor.Indices, 0, dstValuesCount, slot, out idx)) 417Utils.FillIdentity(newIndicesEditor.Indices, denseCount); 422int lim = Utils.FindIndexSorted(dstIndices, 0, dstValues.Length, denseCount); 1353Contracts.CheckParam(0 <= length && length <= Utils.Size(src), nameof(length));
Microsoft.ML.TensorFlow (5)
TensorflowTransform.cs (2)
225return Utils.MarshalInvoke(CreateTensorValueGetter<int>, type.RawType, input, isVector, colIndex, tfShape); 650return Utils.MarshalInvoke(MakeGetter<int>, type, input, iinfo, srcTensorGetters, activeOutputColNames, outputCache);
TensorflowUtils.cs (2)
91if (!(Utils.Size(tensorShape) == 1 && tensorShape[0] <= 0) && 92(Utils.Size(tensorShape) > 0 && tensorShape.Skip(1).All(x => x > 0)))
TensorTypeExtensions.cs (1)
54Utils.EnsureSize(ref array, (int)tensor.size, (int)tensor.size, false);
Microsoft.ML.Vision (3)
DnnRetrainTransform.cs (3)
474return Utils.MarshalInvoke(CreateTensorValueGetter<int>, typeof(UInt32), input, isVector, colIndex, tfShape, true); 476return Utils.MarshalInvoke(CreateTensorValueGetter<int>, type.RawType, input, isVector, colIndex, tfShape, false); 867return Utils.MarshalInvoke(MakeGetter<int>, type, input, iinfo, srcTensorGetters, activeOutputColNames, outputCache);