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.

tf.strings.cs 1.8 kB

5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*****************************************************************************
  2. Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ******************************************************************************/
  13. using System.Collections.Generic;
  14. using Tensorflow.IO;
  15. namespace Tensorflow
  16. {
  17. public partial class tensorflow
  18. {
  19. public StringsApi strings { get; } = new StringsApi();
  20. public class StringsApi
  21. {
  22. string_ops ops = new string_ops();
  23. /// <summary>
  24. /// Return substrings from `Tensor` of strings.
  25. /// </summary>
  26. /// <param name="input"></param>
  27. /// <param name="pos"></param>
  28. /// <param name="len"></param>
  29. /// <param name="name"></param>
  30. /// <param name="uint"></param>
  31. /// <returns></returns>
  32. public Tensor substr(Tensor input, int pos, int len,
  33. string name = null, string @uint = "BYTE")
  34. => ops.substr(input, pos, len, @uint: @uint, name: name);
  35. public Tensor substr(string input, int pos, int len,
  36. string name = null, string @uint = "BYTE")
  37. => ops.substr(input, pos, len, @uint: @uint, name: name);
  38. }
  39. }
  40. }