Browse Source

gfile.cs, Walk(...): Handle case when directory top doesn't exist.

tags/v0.12
Eli Belash 6 years ago
parent
commit
1992bb054a
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/TensorFlowNET.Core/IO/gfile.cs

+ 4
- 0
src/TensorFlowNET.Core/IO/gfile.cs View File

@@ -16,6 +16,7 @@

using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tensorflow.IO
{
@@ -28,6 +29,9 @@ namespace Tensorflow.IO
/// <param name="in_order">Traverse in order if True, post order if False.</param>
public IEnumerable<(string, string[], string[])> Walk(string top, bool in_order = true)
{
if (!Directory.Exists(top))
return Enumerable.Empty<(string, string[], string[])>();

return walk_v2(top, in_order);
}



Loading…
Cancel
Save