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