| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 135562e commit e748a8f
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,5 +22,8 @@ public partial class NDArray | |||
| 22 | 22 | public static NDArray operator <(NDArray lhs, NDArray rhs) => new NDArray(gen_math_ops.less(lhs, rhs)); | |
| 23 | 23 | [AutoNumPy] | |
| 24 | 24 | public static NDArray operator -(NDArray lhs) => new NDArray(gen_math_ops.neg(lhs)); | |
| 25 | + [AutoNumPy] | ||
| 26 | + public static bool operator ==(NDArray lhs, NDArray rhs) => rhs is null ? false : (bool)math_ops.equal(lhs, rhs); | ||
| 27 | + public static bool operator !=(NDArray lhs, NDArray rhs) => !(lhs == rhs); | ||
| 25 | 28 | } | |
| 26 | 29 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,10 +62,16 @@ public static NDArray linspace<T>(T start, T stop, int num = 50, bool endpoint = | |||
| 62 | 62 | [AutoNumPy] | |
| 63 | 63 | public static NDArray load(string file) => tf.numpy.load(file); | |
| 64 | 64 | ||
| 65 | + public static T Load<T>(string path) | ||
| 66 | + where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable | ||
| 67 | + { | ||
| 68 | + using (var stream = new FileStream(path, FileMode.Open)) | ||
| 69 | + return Load<T>(stream); | ||
| 70 | + } | ||
| 71 | + | ||
| 65 | 72 | [AutoNumPy] | |
| 66 | 73 | public static T Load<T>(Stream stream) | |
| 67 | - where T : class, | ||
| 68 | - ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable | ||
| 74 | + where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable | ||
| 69 | 75 | => tf.numpy.Load<T>(stream); | |
| 70 | 76 | ||
| 71 | 77 | [AutoNumPy] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -211,7 +211,10 @@ public string save(Session sess, | |||
| 211 | 211 | export_meta_graph(meta_graph_filename, strip_default_attrs: strip_default_attrs, save_debug_info: save_debug_info); | |
| 212 | 212 | } | |
| 213 | 213 | ||
| 214 | - return _is_empty ? string.Empty : model_checkpoint_path[0].StringData()[0]; | ||
| 214 | + return checkpoint_file; | ||
| 215 | + //var x = model_checkpoint_path[0]; | ||
| 216 | + //var str = x.StringData(); | ||
| 217 | + //return _is_empty ? string.Empty : model_checkpoint_path[0].StringData()[0]; | ||
| 215 | 218 | } | |
| 216 | 219 | ||
| 217 | 220 | public (Saver, object) import_meta_graph(string meta_graph_or_file, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments