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.io.cs 2.4 kB

5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 IoApi io { get; } = new IoApi();
  20. public class IoApi
  21. {
  22. io_ops ops;
  23. public GFile gfile;
  24. public IoApi()
  25. {
  26. ops = new io_ops();
  27. gfile = new GFile();
  28. }
  29. public Tensor read_file(string filename, string name = null)
  30. => ops.read_file(filename, name);
  31. public Tensor read_file(Tensor filename, string name = null)
  32. => ops.read_file(filename, name);
  33. public Operation save_v2(Tensor prefix, string[] tensor_names,
  34. string[] shape_and_slices, Tensor[] tensors, string name = null)
  35. => ops.save_v2(prefix, tensor_names, shape_and_slices, tensors, name: name);
  36. public Tensor[] restore_v2(Tensor prefix, string[] tensor_names,
  37. string[] shape_and_slices, TF_DataType[] dtypes, string name = null)
  38. => ops.restore_v2(prefix, tensor_names, shape_and_slices, dtypes, name: name);
  39. }
  40. public GFile gfile = new GFile();
  41. public ITensorOrOperation[] import_graph_def(GraphDef graph_def,
  42. Dictionary<string, Tensor> input_map = null,
  43. string[] return_elements = null,
  44. string name = null,
  45. OpList producer_op_list = null) => importer.import_graph_def(graph_def, input_map, return_elements, name: name, producer_op_list: producer_op_list);
  46. }
  47. }