You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProtoUtils.cs 821 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Tensorflow.Util
  5. {
  6. internal static class ProtoUtils
  7. {
  8. public static object GetSingleAttrValue(AttrValue value, AttrValue.ValueOneofCase valueCase)
  9. {
  10. return valueCase switch
  11. {
  12. AttrValue.ValueOneofCase.S => value.S.ToStringUtf8(),
  13. AttrValue.ValueOneofCase.I => value.I,
  14. AttrValue.ValueOneofCase.F => value.F,
  15. AttrValue.ValueOneofCase.B => value.B,
  16. AttrValue.ValueOneofCase.Type => value.Type,
  17. AttrValue.ValueOneofCase.Shape => value.Shape,
  18. AttrValue.ValueOneofCase.Tensor => value.Tensor,
  19. AttrValue.ValueOneofCase.Func => value.Func,
  20. };
  21. }
  22. }
  23. }