| @@ -124,5 +124,15 @@ namespace Tensorflow | |||||
| /// <returns>A `Tensor`. Has the same type as `input`.</returns> | /// <returns>A `Tensor`. Has the same type as `input`.</returns> | ||||
| public Tensor placeholder_with_default<T>(T input, int[] shape, string name = null) | public Tensor placeholder_with_default<T>(T input, int[] shape, string name = null) | ||||
| => gen_array_ops.placeholder_with_default(input, shape, name: name); | => gen_array_ops.placeholder_with_default(input, shape, name: name); | ||||
| /// <summary> | |||||
| /// Returns the shape of a tensor. | |||||
| /// </summary> | |||||
| /// <param name="input"></param> | |||||
| /// <param name="name"></param> | |||||
| /// <param name="out_type"></param> | |||||
| /// <returns></returns> | |||||
| public Tensor shape(Tensor input, string name = null, TF_DataType out_type = TF_DataType.TF_INT32) | |||||
| => array_ops.shape_internal(input, name, optimize: true, out_type: out_type); | |||||
| } | } | ||||
| } | } | ||||
| @@ -338,7 +338,7 @@ namespace Tensorflow | |||||
| public static Tensor size(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) | public static Tensor size(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) | ||||
| => size_internal(input, name, optimize: optimize, out_type: out_type); | => size_internal(input, name, optimize: optimize, out_type: out_type); | ||||
| private static Tensor shape_internal(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) | |||||
| public static Tensor shape_internal(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) | |||||
| { | { | ||||
| return tf_with(ops.name_scope(name, "Shape", new { input }), scope => | return tf_with(ops.name_scope(name, "Shape", new { input }), scope => | ||||
| { | { | ||||
| @@ -26,7 +26,7 @@ Docs: https://tensorflownet.readthedocs.io</Description> | |||||
| 5. Overload session.run(), make syntax simpler. | 5. Overload session.run(), make syntax simpler. | ||||
| 6. Add Local Response Normalization. | 6. Add Local Response Normalization. | ||||
| 7. Add tf.image related APIs. | 7. Add tf.image related APIs. | ||||
| 8. Add tf.random_normal, tf.constant, tf.pad. | |||||
| 8. Add tf.random_normal, tf.constant, tf.pad, tf.shape. | |||||
| 9. MultiThread is safe.</PackageReleaseNotes> | 9. MultiThread is safe.</PackageReleaseNotes> | ||||
| <LangVersion>7.3</LangVersion> | <LangVersion>7.3</LangVersion> | ||||
| <FileVersion>0.11.2.0</FileVersion> | <FileVersion>0.11.2.0</FileVersion> | ||||
| @@ -65,11 +65,14 @@ namespace TensorFlowNET.Examples.ImageProcessing.YOLO | |||||
| Tensor output = null; | Tensor output = null; | ||||
| if (method == "resize") | if (method == "resize") | ||||
| { | { | ||||
| tf_with(tf.variable_scope(name), delegate | |||||
| { | |||||
| var input_shape = tf.shape(input_data); | |||||
| }); | |||||
| } | } | ||||
| else if(method == "deconv") | else if(method == "deconv") | ||||
| { | { | ||||
| throw new NotImplementedException("upsample.deconv"); | |||||
| } | } | ||||
| return output; | return output; | ||||
| @@ -14,10 +14,11 @@ namespace TensorFlowNET.UnitTest | |||||
| [TestClass] | [TestClass] | ||||
| public class ImageTest | public class ImageTest | ||||
| { | { | ||||
| string imgPath = "../../../../../data/shasta-daisy.jpg"; | |||||
| string imgPath = "shasta-daisy.jpg"; | |||||
| Tensor contents; | Tensor contents; | ||||
| public ImageTest() | |||||
| [TestInitialize] | |||||
| public void Initialize() | |||||
| { | { | ||||
| imgPath = Path.GetFullPath(imgPath); | imgPath = Path.GetFullPath(imgPath); | ||||
| contents = tf.read_file(imgPath); | contents = tf.read_file(imgPath); | ||||