From 1749b9e4afa92f11f03889e73f671237e4dc771b Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 4 Oct 2022 17:04:08 +0200 Subject: [PATCH] Fix compiler warnings Signed-off-by: brian --- .../main/java/org/deeplearning4j/eval/curves/RocCurve.java | 2 +- .../java/org/deeplearning4j/nn/conf/graph/LayerVertex.java | 1 - .../nn/conf/layers/misc/FrozenLayerWithBackprop.java | 2 ++ .../nn/conf/layers/samediff/SameDiffVertex.java | 2 ++ .../deeplearning4j/nn/conf/layers/util/MaskZeroLayer.java | 6 ++---- .../nn/conf/layers/wrapper/BaseWrapperLayer.java | 2 ++ .../main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java | 2 +- .../java/org/nd4j/aeron/ipc/AeronNDArraySubscriber.java | 4 ++-- .../src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java | 3 ++- .../org/nd4j/aeron/ipc/response/AeronNDArrayResponder.java | 6 +++--- .../java/org/nd4j/aeron/ipc/response/HostPortPublisher.java | 2 +- 11 files changed, 18 insertions(+), 14 deletions(-) diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/RocCurve.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/RocCurve.java index 17b176b9d..824115afa 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/RocCurve.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/eval/curves/RocCurve.java @@ -27,7 +27,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; @Deprecated @Data -@EqualsAndHashCode(exclude = {"auc"}, callSuper = false) +@EqualsAndHashCode(callSuper = false) public class RocCurve extends org.nd4j.evaluation.curves.RocCurve { /** diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/graph/LayerVertex.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/graph/LayerVertex.java index 677e3428c..b1734682d 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/graph/LayerVertex.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/graph/LayerVertex.java @@ -36,7 +36,6 @@ import java.util.Arrays; @NoArgsConstructor @Data -@EqualsAndHashCode(callSuper = false) public class LayerVertex extends GraphVertex { private NeuralNetConfiguration layerConf; diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/misc/FrozenLayerWithBackprop.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/misc/FrozenLayerWithBackprop.java index f782673cb..53d7ff914 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/misc/FrozenLayerWithBackprop.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/misc/FrozenLayerWithBackprop.java @@ -21,6 +21,7 @@ package org.deeplearning4j.nn.conf.layers.misc; import lombok.Data; +import lombok.EqualsAndHashCode; import org.deeplearning4j.nn.api.ParamInitializer; import org.deeplearning4j.nn.api.layers.LayerConstraint; import org.deeplearning4j.nn.conf.NeuralNetConfiguration; @@ -38,6 +39,7 @@ import java.util.Collection; import java.util.List; @Data +@EqualsAndHashCode(callSuper = false) public class FrozenLayerWithBackprop extends BaseWrapperLayer { public FrozenLayerWithBackprop(@JsonProperty("layer") Layer layer) { diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SameDiffVertex.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SameDiffVertex.java index b18aa1cc3..94a13ffec 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SameDiffVertex.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SameDiffVertex.java @@ -21,6 +21,7 @@ package org.deeplearning4j.nn.conf.layers.samediff; import lombok.Data; +import lombok.EqualsAndHashCode; import org.deeplearning4j.nn.api.MaskState; import org.deeplearning4j.nn.api.TrainingConfig; import org.deeplearning4j.nn.conf.GradientNormalization; @@ -44,6 +45,7 @@ import java.util.List; import java.util.Map; @Data +@EqualsAndHashCode(callSuper = false) public abstract class SameDiffVertex extends GraphVertex implements TrainingConfig { private SDVertexParams vertexParams; diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/util/MaskZeroLayer.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/util/MaskZeroLayer.java index 410ea08c5..8a3d309a5 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/util/MaskZeroLayer.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/util/MaskZeroLayer.java @@ -20,10 +20,7 @@ package org.deeplearning4j.nn.conf.layers.util; -import lombok.Data; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; import org.deeplearning4j.nn.conf.InputPreProcessor; import org.deeplearning4j.nn.conf.NeuralNetConfiguration; import org.deeplearning4j.nn.conf.inputs.InputType; @@ -38,6 +35,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Collection; @Data +@EqualsAndHashCode(callSuper = false) public class MaskZeroLayer extends BaseWrapperLayer { private double maskingValue = 0.0; diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/wrapper/BaseWrapperLayer.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/wrapper/BaseWrapperLayer.java index 051a68968..ca90ee7a1 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/wrapper/BaseWrapperLayer.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/conf/layers/wrapper/BaseWrapperLayer.java @@ -21,6 +21,7 @@ package org.deeplearning4j.nn.conf.layers.wrapper; import lombok.Data; +import lombok.EqualsAndHashCode; import org.deeplearning4j.nn.api.ParamInitializer; import org.deeplearning4j.nn.conf.GradientNormalization; import org.deeplearning4j.nn.conf.InputPreProcessor; @@ -33,6 +34,7 @@ import org.nd4j.linalg.learning.regularization.Regularization; import java.util.List; @Data +@EqualsAndHashCode(callSuper = false) public abstract class BaseWrapperLayer extends Layer { protected Layer underlying; diff --git a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java index 20affc794..9e8d1660f 100644 --- a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java +++ b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArrayPublisher.java @@ -61,7 +61,7 @@ public class AeronNDArrayPublisher implements AutoCloseable { public final static int NUM_RETRIES = 100; private boolean compress = true; private static final BusySpinIdleStrategy busySpinIdleStrategy = new BusySpinIdleStrategy(); - private int publishRetryTimeOut = 3000; + @Builder.Default private int publishRetryTimeOut = 3000; private void init() { channel = channel == null ? "aeron:udp?endpoint=localhost:40123" : channel; diff --git a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArraySubscriber.java b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArraySubscriber.java index 91a3dbea5..204893e97 100644 --- a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArraySubscriber.java +++ b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/AeronNDArraySubscriber.java @@ -45,7 +45,7 @@ public class AeronNDArraySubscriber implements AutoCloseable { private String channel; // A unique identifier for a stream within a channel. Stream ID 0 is reserved // for internal use and should not be used by applications. - private int streamId = -1; + @Builder.Default private int streamId = -1; // Maximum number of message fragments to receive during a single 'poll' operation private int fragmentLimitCount; // Create a context, needed for client connection to media driver @@ -57,7 +57,7 @@ public class AeronNDArraySubscriber implements AutoCloseable { private NDArrayCallback ndArrayCallback; private Aeron aeron; private Subscription subscription; - private AtomicBoolean launched = new AtomicBoolean(false); + @Builder.Default private AtomicBoolean launched = new AtomicBoolean(false); private Executor executors; diff --git a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java index 13022f78a..3658a8006 100644 --- a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java +++ b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java @@ -50,7 +50,8 @@ public class NDArrayMessage implements Serializable { private long index; private int[] dimensions; private byte[] chunk; - private int numChunks = 0; + + @Builder.Default private int numChunks = 0; //default dimensions: a 1 length array of -1 means use the whole array for an update. private static int[] WHOLE_ARRAY_UPDATE = {-1}; //represents the constant for indicating using the whole array for an update (-1) diff --git a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/AeronNDArrayResponder.java b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/AeronNDArrayResponder.java index d71ba3992..cea7193e8 100644 --- a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/AeronNDArrayResponder.java +++ b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/AeronNDArrayResponder.java @@ -43,17 +43,17 @@ public class AeronNDArrayResponder implements AutoCloseable { private String channel; // A unique identifier for a stream within a channel. Stream ID 0 is reserved // for internal use and should not be used by applications. - private int streamId = -1; + @Builder.Default private int streamId = -1; // A unique identifier for a stream within a channel. Stream ID 0 is reserved // for internal use and should not be used by applications. - private int responseStreamId = -1; + @Builder.Default private int responseStreamId = -1; // Maximum number of message fragments to receive during a single 'poll' operation private int fragmentLimitCount; // Create a context, needed for client connection to media driver // A separate media driver process need to run prior to running this application private Aeron.Context ctx; - private AtomicBoolean running = new AtomicBoolean(true); + @Builder.Default private AtomicBoolean running = new AtomicBoolean(true); private final AtomicBoolean init = new AtomicBoolean(false); private static Logger log = LoggerFactory.getLogger(AeronNDArrayResponder.class); private NDArrayHolder ndArrayHolder; diff --git a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/HostPortPublisher.java b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/HostPortPublisher.java index 7a9c5826c..083f78a7d 100644 --- a/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/HostPortPublisher.java +++ b/cavis-nd4j/cavis-nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/response/HostPortPublisher.java @@ -42,7 +42,7 @@ public class HostPortPublisher implements AutoCloseable { private int streamId; // The channel (an endpoint identifier) to send the message to private String channel; - private boolean init = false; + @Builder.Default private boolean init = false; private Aeron.Context ctx; private Aeron aeron; private Publication publication;