From ce2ef20f96c1b9944c567cc98e3f77a8257a3aa2 Mon Sep 17 00:00:00 2001 From: raver119 Date: Tue, 19 Nov 2019 13:54:07 +0300 Subject: [PATCH] additional reverse signatures Signed-off-by: raver119 --- .../ops/impl/transforms/custom/Reverse.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/custom/Reverse.java b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/custom/Reverse.java index b4aa329a6..d1648abab 100644 --- a/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/custom/Reverse.java +++ b/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/impl/transforms/custom/Reverse.java @@ -47,6 +47,29 @@ public class Reverse extends DynamicCustomOp { this.inPlace = true; } + + /** + * This constructor allows to specify axis for Reverse operation + * @param x + * @param axis + */ + public Reverse(INDArray x, int... axis){ + super(new INDArray[]{x}, new INDArray[0]); + this.inPlace = false; + addIArgument(axis); + } + + /** + * This constructor allows to specify axis for Reverse operation + * @param x + * @param axis + */ + public Reverse(INDArray x, INDArray z, int... axis){ + super(new INDArray[]{x}, new INDArray[] {z}); + this.inPlace = false; + addIArgument(axis); + } + /** * Reverses whole array for compatibility with OldReverse. *