3 instantiations of Optional
Microsoft.ML.Core (3)
EntryPoints\ModuleArgs.cs (3)
694
return new
Optional
<T>(false, value);
699
return new
Optional
<T>(true, value);
716
return new
Optional
<T>(true, value);
44 references to Optional
Microsoft.ML.Core (10)
EntryPoints\EntryPointUtils.cs (5)
23
if (obj is
Optional
<T> asOptional)
69
if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(
Optional
<>) && fieldVal == null)
75
if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(
Optional
<>))
106
public static string FindColumnOrNull(IExceptionContext ectx, DataViewSchema schema,
Optional
<string> value)
127
public static T? AsNullable<T>(this
Optional
<T> opt) where T : struct
EntryPoints\ModuleArgs.cs (5)
606
if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(
Optional
<>) || type.GetGenericTypeDefinition() == typeof(Nullable<>)))
692
public static
Optional
<T> Implicit(T value)
697
public static
Optional
<T> Explicit(T value)
705
public static implicit operator T(
Optional
<T> optional)
714
public static implicit operator
Optional
<T>(T value)
Microsoft.ML.Data (13)
EntryPoints\EntryPointNode.cs (3)
184
if (variableType.IsGenericType && variableType.GetGenericTypeDefinition() == typeof(
Optional
<>))
545
ch.Assert(inputColName is string || inputColName is
Optional
<string>);
546
var str = inputColName is string ? (string)inputColName : ((
Optional
<string>)inputColName).Value;
EntryPoints\InputBase.cs (1)
41
public static string FindColumn(IExceptionContext ectx, DataViewSchema schema,
Optional
<string> value)
EntryPoints\InputBuilder.cs (9)
129
(type.GetGenericTypeDefinition() == typeof(
Optional
<>) ||
277
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(
Optional
<>))
357
if (deftype.IsGenericType && deftype.GetGenericTypeDefinition() == typeof(
Optional
<>))
393
Contracts.Assert(type.IsGenericType && type.GetGenericTypeDefinition() == typeof(
Optional
<>));
413
if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(
Optional
<>) || type.GetGenericTypeDefinition() == typeof(Nullable<>)))
415
if (type.GetGenericTypeDefinition() == typeof(
Optional
<>) && value.HasValues)
601
return (
Optional
<T>)(T)value;
624
if (genericType != typeof(
Optional
<>) &&
630
bool isOptional = outerType.GetGenericTypeDefinition() == typeof(
Optional
<>);
Microsoft.ML.EntryPoints (21)
CrossValidationMacro.cs (12)
84
public
Optional
<string> WeightColumn =
Optional
<string>.Implicit(DefaultColumnNames.Weight);
87
public
Optional
<string> GroupColumn =
Optional
<string>.Implicit(DefaultColumnNames.GroupId);
90
public
Optional
<string> NameColumn =
Optional
<string>.Implicit(DefaultColumnNames.Name);
132
public
Optional
<string> WeightColumn =
Optional
<string>.Implicit(DefaultColumnNames.Weight);
135
public
Optional
<string> GroupColumn =
Optional
<string>.Implicit(DefaultColumnNames.GroupId);
138
public
Optional
<string> NameColumn =
Optional
<string>.Implicit(DefaultColumnNames.Name);
JsonUtils\JsonManifestUtils.cs (3)
92
if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(
Optional
<>) || type.GetGenericTypeDefinition() == typeof(Nullable<>)))
189
fieldInfo.FieldType.GetGenericTypeDefinition() == typeof(
Optional
<>))
408
if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(
Optional
<>))
TrainTestMacro.cs (6)
68
public
Optional
<string> WeightColumn =
Optional
<string>.Implicit(DefaultColumnNames.Weight);
71
public
Optional
<string> GroupColumn =
Optional
<string>.Implicit(DefaultColumnNames.GroupId);
74
public
Optional
<string> NameColumn =
Optional
<string>.Implicit(DefaultColumnNames.Name);