| @@ -22,5 +22,8 @@ namespace Tensorflow.NumPy | |||||
| public static NDArray operator <(NDArray lhs, NDArray rhs) => new NDArray(gen_math_ops.less(lhs, rhs)); | public static NDArray operator <(NDArray lhs, NDArray rhs) => new NDArray(gen_math_ops.less(lhs, rhs)); | ||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray operator -(NDArray lhs) => new NDArray(gen_math_ops.neg(lhs)); | public static NDArray operator -(NDArray lhs) => new NDArray(gen_math_ops.neg(lhs)); | ||||
| [AutoNumPy] | |||||
| public static bool operator ==(NDArray lhs, NDArray rhs) => rhs is null ? false : (bool)math_ops.equal(lhs, rhs); | |||||
| public static bool operator !=(NDArray lhs, NDArray rhs) => !(lhs == rhs); | |||||
| } | } | ||||
| } | } | ||||
| @@ -62,10 +62,16 @@ namespace Tensorflow.NumPy | |||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray load(string file) => tf.numpy.load(file); | public static NDArray load(string file) => tf.numpy.load(file); | ||||
| public static T Load<T>(string path) | |||||
| where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable | |||||
| { | |||||
| using (var stream = new FileStream(path, FileMode.Open)) | |||||
| return Load<T>(stream); | |||||
| } | |||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static T Load<T>(Stream stream) | public static T Load<T>(Stream stream) | ||||
| where T : class, | |||||
| ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable | |||||
| where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable | |||||
| => tf.numpy.Load<T>(stream); | => tf.numpy.Load<T>(stream); | ||||
| [AutoNumPy] | [AutoNumPy] | ||||
| @@ -211,7 +211,10 @@ namespace Tensorflow | |||||
| export_meta_graph(meta_graph_filename, strip_default_attrs: strip_default_attrs, save_debug_info: save_debug_info); | export_meta_graph(meta_graph_filename, strip_default_attrs: strip_default_attrs, save_debug_info: save_debug_info); | ||||
| } | } | ||||
| return _is_empty ? string.Empty : model_checkpoint_path[0].StringData()[0]; | |||||
| return checkpoint_file; | |||||
| //var x = model_checkpoint_path[0]; | |||||
| //var str = x.StringData(); | |||||
| //return _is_empty ? string.Empty : model_checkpoint_path[0].StringData()[0]; | |||||
| } | } | ||||
| public (Saver, object) import_meta_graph(string meta_graph_or_file, | public (Saver, object) import_meta_graph(string meta_graph_or_file, | ||||