Browse Source

add zip<T1, T2, T3>()

tags/v0.12
Oceania2018 6 years ago
parent
commit
8e054afd8d
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      src/TensorFlowNET.Core/Binding.Util.cs

+ 7
- 0
src/TensorFlowNET.Core/Binding.Util.cs View File

@@ -165,6 +165,12 @@ namespace Tensorflow
yield return (t1[i], t2[i]);
}

public static IEnumerable<(T1, T2, T3)> zip<T1, T2, T3>(IList<T1> t1, IList<T2> t2, IList<T3> t3)
{
for (int i = 0; i < t1.Count; i++)
yield return (t1[i], t2[i], t3[i]);
}

public static IEnumerable<(T1, T2)> zip<T1, T2>(NDArray t1, NDArray t2)
where T1: unmanaged
where T2: unmanaged
@@ -203,6 +209,7 @@ namespace Tensorflow
yield return (i, values[i]);
}

[DebuggerStepThrough]
public static Dictionary<string, object> ConvertToDict(object dyn)
{
var dictionary = new Dictionary<string, object>();


Loading…
Cancel
Save