-
Notifications
You must be signed in to change notification settings - Fork 539
Expand file tree
/
Copy pathProtoUtils.cs
More file actions
24 lines (23 loc) · 821 Bytes
/
ProtoUtils.cs
File metadata and controls
24 lines (23 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.Text;
namespace Tensorflow.Util
{
internal static class ProtoUtils
{
public static object GetSingleAttrValue(AttrValue value, AttrValue.ValueOneofCase valueCase)
{
return valueCase switch
{
AttrValue.ValueOneofCase.S => value.S.ToStringUtf8(),
AttrValue.ValueOneofCase.I => value.I,
AttrValue.ValueOneofCase.F => value.F,
AttrValue.ValueOneofCase.B => value.B,
AttrValue.ValueOneofCase.Type => value.Type,
AttrValue.ValueOneofCase.Shape => value.Shape,
AttrValue.ValueOneofCase.Tensor => value.Tensor,
AttrValue.ValueOneofCase.Func => value.Func,
};
}
}
}