@@ -27,6 +27,6 @@ Related merged [commits](https://github.com/SciSharp/TensorFlow.NET/commit/854a5 | |||||
On Windows, the tar command does not support extracting archives with symlinks. So when `dotnet pack` runs on Windows it will only package the Windows binaries. | On Windows, the tar command does not support extracting archives with symlinks. So when `dotnet pack` runs on Windows it will only package the Windows binaries. | ||||
1. Run `dotnet pack SciSharp.TensorFlow.Redist.nupkgproj` under `src/SciSharp.TensorFlow.Redist` directory in Linux. | 1. Run `dotnet pack SciSharp.TensorFlow.Redist.nupkgproj` under `src/SciSharp.TensorFlow.Redist` directory in Linux. | ||||
2. Run `dotnet nuget push SciSharp.TensorFlow.Redist.2.3.0.nupkg -k APIKEY -s https://api.nuget.org/v3/index.json` | |||||
2. Run `dotnet nuget push SciSharp.TensorFlow.Redist.2.3.1.nupkg -k APIKEY -s https://api.nuget.org/v3/index.json -t 600` | |||||
@@ -208,8 +208,8 @@ namespace Tensorflow | |||||
=> image_ops_impl.non_max_suppression_padded(boxes, scores, max_output_size, iou_threshold, score_threshold, pad_to_max_output_size, | => image_ops_impl.non_max_suppression_padded(boxes, scores, max_output_size, iou_threshold, score_threshold, pad_to_max_output_size, | ||||
name, sorted_input, canonicalized_coordinates, tile_size); | name, sorted_input, canonicalized_coordinates, tile_size); | ||||
public Tensor resize(Tensor image, TensorShape size) | |||||
=> image_ops_impl.resize_images_v2(image, size); | |||||
public Tensor resize(Tensor image, TensorShape size, string method = ResizeMethod.BILINEAR) | |||||
=> image_ops_impl.resize_images_v2(image, size, method: method); | |||||
public Tensor resize_bilinear(Tensor images, Tensor size, bool align_corners = false, bool half_pixel_centers = false, string name = null) | public Tensor resize_bilinear(Tensor images, Tensor size, bool align_corners = false, bool half_pixel_centers = false, string name = null) | ||||
=> gen_image_ops.resize_bilinear(images, size, align_corners: align_corners, half_pixel_centers: half_pixel_centers, name: name); | => gen_image_ops.resize_bilinear(images, size, align_corners: align_corners, half_pixel_centers: half_pixel_centers, name: name); | ||||
@@ -22,6 +22,10 @@ namespace Tensorflow | |||||
TensorShape shape, | TensorShape shape, | ||||
string name = null) => gen_array_ops.reshape(tensor, shape, name); | string name = null) => gen_array_ops.reshape(tensor, shape, name); | ||||
public Tensor reshape(Tensor tensor, | |||||
Tensor[] shape, | |||||
string name = null) => gen_array_ops.reshape(tensor, shape, name); | |||||
public Tensor reshape(Tensor tensor, | public Tensor reshape(Tensor tensor, | ||||
Tensor shape, | Tensor shape, | ||||
string name = null) => gen_array_ops.reshape(tensor, shape, name); | string name = null) => gen_array_ops.reshape(tensor, shape, name); | ||||
@@ -15,6 +15,8 @@ | |||||
******************************************************************************/ | ******************************************************************************/ | ||||
using System; | using System; | ||||
using System.Linq; | |||||
using Tensorflow.Contexts; | |||||
using static Tensorflow.Binding; | using static Tensorflow.Binding; | ||||
namespace Tensorflow | namespace Tensorflow | ||||
@@ -221,17 +223,21 @@ namespace Tensorflow | |||||
public static Tensor resize_nearest_neighbor<Tsize>(Tensor images, Tsize size, bool align_corners = false, | public static Tensor resize_nearest_neighbor<Tsize>(Tensor images, Tsize size, bool align_corners = false, | ||||
bool half_pixel_centers = false, string name = null) | bool half_pixel_centers = false, string name = null) | ||||
{ | |||||
var op = tf.OpDefLib._apply_op_helper("ResizeNearestNeighbor", name: name, args: new | |||||
{ | |||||
images, | |||||
size, | |||||
align_corners, | |||||
half_pixel_centers | |||||
}); | |||||
return op.output; | |||||
} | |||||
=> tf.Context.RunInAutoMode(() | |||||
=> tf.OpDefLib._apply_op_helper("ResizeNearestNeighbor", name: name, args: new | |||||
{ | |||||
images, | |||||
size, | |||||
align_corners, | |||||
half_pixel_centers | |||||
}).output, () | |||||
=> tf.Runner.TFE_FastPathExecute(tf.Context, tf.Context.DeviceName, | |||||
"ResizeNearestNeighbor", name, | |||||
null, | |||||
images, size, | |||||
"align_corners", align_corners, | |||||
"half_pixel_centers", half_pixel_centers).FirstOrDefault(), | |||||
images); | |||||
public static Tensor resize_nearest_neighbor_grad<Tsize>(Tensor grads, Tsize size, bool align_corners = false, | public static Tensor resize_nearest_neighbor_grad<Tsize>(Tensor grads, Tsize size, bool align_corners = false, | ||||
bool half_pixel_centers = false, string name = null) | bool half_pixel_centers = false, string name = null) | ||||
@@ -2168,7 +2168,10 @@ new_height, new_width"); | |||||
{ | { | ||||
if (method == ResizeMethod.BILINEAR) | if (method == ResizeMethod.BILINEAR) | ||||
return gen_image_ops.resize_bilinear(images, size, half_pixel_centers: true); | return gen_image_ops.resize_bilinear(images, size, half_pixel_centers: true); | ||||
throw new NotImplementedException(""); | |||||
else if (method == ResizeMethod.NEAREST_NEIGHBOR) | |||||
return gen_image_ops.resize_nearest_neighbor(images, size, half_pixel_centers: true); | |||||
throw new NotImplementedException("resize_images_v2"); | |||||
}; | }; | ||||
return _resize_images_common(images, resize_fn, ops.convert_to_tensor(size), | return _resize_images_common(images, resize_fn, ops.convert_to_tensor(size), | ||||
preserve_aspect_ratio: preserve_aspect_ratio, | preserve_aspect_ratio: preserve_aspect_ratio, | ||||