| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2995c36 commit 5f595eb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | - using System; | ||
| 1 | + using NumSharp.Core; | ||
| 2 | + using System; | ||
| 2 | 3 | using System.Collections.Generic; | |
| 3 | 4 | using System.Text; | |
| 4 | 5 | ||
@@ -44,6 +45,24 @@ public virtual byte[] run(Tensor fetches, Dictionary<Tensor, object> feed_dict = | |||
| 44 | 45 | ||
| 45 | 46 | private unsafe byte[] _run(Tensor fetches, Dictionary<Tensor, object> feed_dict = null) | |
| 46 | 47 | { | |
| 48 | + var feed_dict_tensor = new Dictionary<Tensor, NDArray>(); | ||
| 49 | + | ||
| 50 | + if (feed_dict != null) | ||
| 51 | + { | ||
| 52 | + NDArray np_val = null; | ||
| 53 | + foreach (var feed in feed_dict) | ||
| 54 | + { | ||
| 55 | + switch (feed.Value) | ||
| 56 | + { | ||
| 57 | + case float value: | ||
| 58 | + np_val = np.asarray(value); | ||
| 59 | + break; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + feed_dict_tensor[feed.Key] = np_val; | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + | ||
| 47 | 66 | var status = new Status(); | |
| 48 | 67 | ||
| 49 | 68 | c_api.TF_SessionRun(_session, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,8 @@ public class Tensor | |||
| 13 | 13 | private DataType _dtype; | |
| 14 | 14 | public DataType dtype => _dtype; | |
| 15 | 15 | ||
| 16 | + public string name; | ||
| 17 | + | ||
| 16 | 18 | public Tensor(Operation op, int value_index, DataType dtype) | |
| 17 | 19 | { | |
| 18 | 20 | _op = op; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments