ExplanationMetadata_InputMetadata.fromJson constructor
ExplanationMetadata_InputMetadata.fromJson(
- Object? j
Implementation
factory ExplanationMetadata_InputMetadata.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return ExplanationMetadata_InputMetadata(
inputBaselines: switch (json['inputBaselines']) {
null => [],
List<Object?> $1 => [for (final i in $1) protobuf.Value.fromJson(i)],
_ => throw const FormatException('"inputBaselines" is not a list'),
},
inputTensorName: switch (json['inputTensorName']) {
null => '',
Object $1 => decodeString($1),
},
encoding: switch (json['encoding']) {
null => ExplanationMetadata_InputMetadata_Encoding.$default,
Object $1 => ExplanationMetadata_InputMetadata_Encoding.fromJson($1),
},
modality: switch (json['modality']) {
null => '',
Object $1 => decodeString($1),
},
featureValueDomain: switch (json['featureValueDomain']) {
null => null,
Object $1 =>
ExplanationMetadata_InputMetadata_FeatureValueDomain.fromJson($1),
},
indicesTensorName: switch (json['indicesTensorName']) {
null => '',
Object $1 => decodeString($1),
},
denseShapeTensorName: switch (json['denseShapeTensorName']) {
null => '',
Object $1 => decodeString($1),
},
indexFeatureMapping: switch (json['indexFeatureMapping']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"indexFeatureMapping" is not a list'),
},
encodedTensorName: switch (json['encodedTensorName']) {
null => '',
Object $1 => decodeString($1),
},
encodedBaselines: switch (json['encodedBaselines']) {
null => [],
List<Object?> $1 => [for (final i in $1) protobuf.Value.fromJson(i)],
_ => throw const FormatException('"encodedBaselines" is not a list'),
},
visualization: switch (json['visualization']) {
null => null,
Object $1 => ExplanationMetadata_InputMetadata_Visualization.fromJson(
$1,
),
},
groupName: switch (json['groupName']) {
null => '',
Object $1 => decodeString($1),
},
);
}