From a2792424593d571e5bf673f52301087f78996240 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 11 Oct 2022 13:52:52 +0200 Subject: [PATCH] More test fixes Signed-off-by: brian --- .../org/datavec/api/util/files/URIUtil.java | 4 +- .../cavis-datavec-data-arrow}/build.gradle | 0 .../org/datavec/arrow/ArrowConverter.java | 0 .../arrow/recordreader/ArrowRecord.java | 0 .../arrow/recordreader/ArrowRecordReader.java | 0 .../arrow/recordreader/ArrowRecordWriter.java | 0 .../ArrowWritableRecordBatch.java | 0 .../ArrowWritableRecordTimeSeriesBatch.java | 0 .../org/datavec/arrow/ArrowConverterTest.java | 0 .../arrow/AssertTestsExtendBaseClass.java | 0 .../org/datavec/arrow/RecordMapperTest.java | 0 ...rowWritableRecordTimeSeriesBatchTests.java | 0 .../cavis-datavec-local/build.gradle | 2 +- .../common/config/DL4JSystemProperties.java | 2 + cavis-dnn/cavis-dnn-nn/build.gradle | 1 + .../deeplearning4j/nn/layers/HelperUtils.java | 116 ++++++++++++++++++ .../deeplearning4j/nn/layers/LayerHelper.java | 2 + .../nn/layers/mkldnn/BaseMKLDNNHelper.java | 4 + .../layers/mkldnn/MKLDNNBatchNormHelper.java | 5 + .../nn/layers/mkldnn/MKLDNNLSTMHelper.java | 7 ++ ...KLDNNLocalResponseNormalizationHelper.java | 1 + .../layers/recurrent/BidirectionalLayer.java | 5 + .../nn/layers/HelperUtilsTest.java | 31 +---- settings.gradle | 2 +- 24 files changed, 149 insertions(+), 33 deletions(-) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/build.gradle (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/main/java/org/datavec/arrow/ArrowConverter.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/main/java/org/datavec/arrow/recordreader/ArrowRecord.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/main/java/org/datavec/arrow/recordreader/ArrowRecordReader.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/main/java/org/datavec/arrow/recordreader/ArrowRecordWriter.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordBatch.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatch.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/test/java/org/datavec/arrow/ArrowConverterTest.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/test/java/org/datavec/arrow/AssertTestsExtendBaseClass.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/test/java/org/datavec/arrow/RecordMapperTest.java (100%) rename cavis-datavec/{cavis-datavec-arrow => cavis-datavec-data/cavis-datavec-data-arrow}/src/test/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatchTests.java (100%) create mode 100644 cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/HelperUtils.java diff --git a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/util/files/URIUtil.java b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/util/files/URIUtil.java index 5469476db..82911ebb4 100644 --- a/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/util/files/URIUtil.java +++ b/cavis-datavec/cavis-datavec-api/src/main/java/org/datavec/api/util/files/URIUtil.java @@ -20,13 +20,15 @@ package org.datavec.api.util.files; +import lombok.NonNull; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; public class URIUtil { - public static URI fileToURI(File f) { + public static URI fileToURI(@NonNull File f) { try { // manually construct URI (this is faster) String sp = slashify(f.getAbsoluteFile().getPath(), false); diff --git a/cavis-datavec/cavis-datavec-arrow/build.gradle b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/build.gradle similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/build.gradle rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/build.gradle diff --git a/cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecord.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecord.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecord.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecord.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordReader.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordReader.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordReader.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordReader.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordWriter.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordWriter.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordWriter.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowRecordWriter.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordBatch.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordBatch.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordBatch.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordBatch.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatch.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatch.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatch.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/main/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatch.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/ArrowConverterTest.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/ArrowConverterTest.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/ArrowConverterTest.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/ArrowConverterTest.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/AssertTestsExtendBaseClass.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/AssertTestsExtendBaseClass.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/AssertTestsExtendBaseClass.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/AssertTestsExtendBaseClass.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/RecordMapperTest.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/RecordMapperTest.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/RecordMapperTest.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/RecordMapperTest.java diff --git a/cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatchTests.java b/cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatchTests.java similarity index 100% rename from cavis-datavec/cavis-datavec-arrow/src/test/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatchTests.java rename to cavis-datavec/cavis-datavec-data/cavis-datavec-data-arrow/src/test/java/org/datavec/arrow/recordreader/ArrowWritableRecordTimeSeriesBatchTests.java diff --git a/cavis-datavec/cavis-datavec-local/build.gradle b/cavis-datavec/cavis-datavec-local/build.gradle index 153bf0499..b9fb9c07c 100644 --- a/cavis-datavec/cavis-datavec-local/build.gradle +++ b/cavis-datavec/cavis-datavec-local/build.gradle @@ -23,7 +23,7 @@ apply from: "${project.rootProject.projectDir}/createTestBackends.gradle" dependencies { implementation "com.codepoetics:protonpack:1.15" implementation projects.cavisDatavec.cavisDatavecApi - implementation projects.cavisDatavec.cavisDatavecArrow + implementation projects.cavisDatavec.cavisDatavecData.cavisDatavecDataArrow implementation projects.cavisDnn.cavisDnnApi implementation "com.google.guava:guava" diff --git a/cavis-dnn/cavis-dnn-common/src/main/java/org/deeplearning4j/common/config/DL4JSystemProperties.java b/cavis-dnn/cavis-dnn-common/src/main/java/org/deeplearning4j/common/config/DL4JSystemProperties.java index 4a8299eb0..494e07c9a 100644 --- a/cavis-dnn/cavis-dnn-common/src/main/java/org/deeplearning4j/common/config/DL4JSystemProperties.java +++ b/cavis-dnn/cavis-dnn-common/src/main/java/org/deeplearning4j/common/config/DL4JSystemProperties.java @@ -40,6 +40,8 @@ public class DL4JSystemProperties { */ public static final String DL4J_RESOURCES_DIR_PROPERTY = "org.deeplearning4j.resources.directory"; + public static final String DISABLE_HELPER_PROPERTY = "org.deeplearning4j.disablehelperloading"; + public static final String HELPER_DISABLE_DEFAULT_VALUE = "false"; /** * Applicability: Numerous modules, including deeplearning4j-datasets and deeplearning4j-zoo
* Description: Used to set the base URL for hosting of resources such as datasets (like MNIST) and pretrained diff --git a/cavis-dnn/cavis-dnn-nn/build.gradle b/cavis-dnn/cavis-dnn-nn/build.gradle index d9792730a..3ffdbee6a 100644 --- a/cavis-dnn/cavis-dnn-nn/build.gradle +++ b/cavis-dnn/cavis-dnn-nn/build.gradle @@ -18,6 +18,7 @@ * ***************************************************************************** * */ +apply from: "${project.rootProject.projectDir}/createTestBackends.gradle" dependencies { implementation projects.cavisDnn.cavisDnnData.cavisDnnDataUtilityIterators diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/HelperUtils.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/HelperUtils.java new file mode 100644 index 000000000..eb59a2c5f --- /dev/null +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/HelperUtils.java @@ -0,0 +1,116 @@ +/* + * ****************************************************************************** + * * + * * + * * This program and the accompanying materials are made available under the + * * terms of the Apache License, Version 2.0 which is available at + * * https://www.apache.org/licenses/LICENSE-2.0. + * * + * * See the NOTICE file distributed with this work for additional + * * information regarding copyright ownership. + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * * License for the specific language governing permissions and limitations + * * under the License. + * * + * * SPDX-License-Identifier: Apache-2.0 + * ***************************************************************************** + */ +package org.deeplearning4j.nn.layers; + +import lombok.extern.slf4j.Slf4j; +import org.deeplearning4j.common.config.DL4JClassLoading; +import org.nd4j.linalg.factory.Nd4j; + +import static org.deeplearning4j.common.config.DL4JSystemProperties.DISABLE_HELPER_PROPERTY; +import static org.deeplearning4j.common.config.DL4JSystemProperties.HELPER_DISABLE_DEFAULT_VALUE; + +/** + * Simple meta helper util class for instantiating + * platform specific layer helpers that handle interaction with + * lower level libraries like cudnn and onednn. + * + * @author Adam Gibson + */ +@Slf4j +public class HelperUtils { + + + /** + * Creates a {@link LayerHelper} + * for use with platform specific code. + * @param the actual class type to be returned + * @param cudnnHelperClassName the cudnn class name + * @param oneDnnClassName the one dnn class name + * @param layerHelperSuperClass the layer helper super class + * @param layerName the name of the layer to be created + * @param arguments the arguments to be used in creation of the layer + * @return + */ + public static T createHelper(String cudnnHelperClassName, + String oneDnnClassName, + Class layerHelperSuperClass, + String layerName, + Object... arguments) { + + Boolean disabled = Boolean.parseBoolean(System.getProperty(DISABLE_HELPER_PROPERTY,HELPER_DISABLE_DEFAULT_VALUE)); + if(disabled) { + System.out.println("Disabled helper creation, returning null"); + return null; + } + String backend = Nd4j.getExecutioner().getEnvironmentInformation().getProperty("backend"); + LayerHelper helperRet = null; + if("CUDA".equalsIgnoreCase(backend) && cudnnHelperClassName != null && !cudnnHelperClassName.isEmpty()) { + if(DL4JClassLoading.loadClassByName(cudnnHelperClassName) != null) { + log.debug("Attempting to initialize cudnn helper {}",cudnnHelperClassName); + helperRet = (LayerHelper) DL4JClassLoading.createNewInstance( + cudnnHelperClassName, + (Class) layerHelperSuperClass, + new Object[]{arguments}); + log.debug("Cudnn helper {} successfully initialized",cudnnHelperClassName); + + } + else { + log.warn("Unable to find class {} using the classloader set for Dl4jClassLoading. Trying to use class loader that loaded the class {} instead.",cudnnHelperClassName,layerHelperSuperClass.getName()); + ClassLoader classLoader = DL4JClassLoading.getDl4jClassloader(); + DL4JClassLoading.setDl4jClassloaderFromClass(layerHelperSuperClass); + try { + helperRet = (LayerHelper) DL4JClassLoading.createNewInstance( + cudnnHelperClassName, + (Class) layerHelperSuperClass, + arguments); + + } catch (Exception e) { + log.warn("Unable to use helper implementation {} for helper type {}, please check your classpath. Falling back to built in normal methods for now.",cudnnHelperClassName,layerHelperSuperClass.getName()); + } + + log.warn("Returning class loader to original one."); + DL4JClassLoading.setDl4jClassloader(classLoader); + + } + + if (helperRet != null && !helperRet.checkSupported()) { + return null; + } + + if(helperRet != null) { + log.debug("{} successfully initialized",cudnnHelperClassName); + } + + } else if("CPU".equalsIgnoreCase(backend) && oneDnnClassName != null && !oneDnnClassName.isEmpty()) { + helperRet = DL4JClassLoading.createNewInstance( + oneDnnClassName, + arguments); + log.trace("Created oneDNN helper: {}, layer {}", oneDnnClassName,layerName); + } + + if (helperRet != null && !helperRet.checkSupported()) { + log.debug("Removed helper {} as not supported", helperRet.getClass()); + return null; + } + + return (T) helperRet; + } + +} \ No newline at end of file diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/LayerHelper.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/LayerHelper.java index fd3bc4ce3..82fc974ac 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/LayerHelper.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/LayerHelper.java @@ -37,4 +37,6 @@ public interface LayerHelper { */ Map helperMemoryUse(); + boolean checkSupported(); + } diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/BaseMKLDNNHelper.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/BaseMKLDNNHelper.java index 0e25760b8..a349eef20 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/BaseMKLDNNHelper.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/BaseMKLDNNHelper.java @@ -59,4 +59,8 @@ public class BaseMKLDNNHelper { } } + public boolean checkSupported() { + return mklDnnEnabled(); + } + } diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNBatchNormHelper.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNBatchNormHelper.java index 27fec5626..388125e82 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNBatchNormHelper.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNBatchNormHelper.java @@ -197,4 +197,9 @@ public class MKLDNNBatchNormHelper implements BatchNormalizationHelper { public Map helperMemoryUse() { return Collections.emptyMap(); } + + @Override + public boolean checkSupported() { + return BaseMKLDNNHelper.mklDnnEnabled(); + } } diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLSTMHelper.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLSTMHelper.java index 353d7c664..a8803eda2 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLSTMHelper.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLSTMHelper.java @@ -30,6 +30,7 @@ import org.deeplearning4j.nn.workspace.ArrayType; import org.deeplearning4j.nn.workspace.LayerWorkspaceMgr; import org.nd4j.linalg.activations.IActivation; import org.nd4j.linalg.activations.impl.*; +import org.nd4j.linalg.api.buffer.DataType; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.api.ops.DynamicCustomOp; import org.nd4j.linalg.api.shape.LongShapeDescriptor; @@ -43,6 +44,7 @@ import java.util.List; import java.util.Map; public class MKLDNNLSTMHelper implements LSTMHelper { + public MKLDNNLSTMHelper(DataType dataType) {} @Override public boolean checkSupported(IActivation gateActivationFn, IActivation activationFn, boolean hasPeepholeConnections) { //TODO check other activation functions for MKLDNN @@ -159,6 +161,11 @@ public class MKLDNNLSTMHelper implements LSTMHelper { return Collections.emptyMap(); } + @Override + public boolean checkSupported() { + return BaseMKLDNNHelper.mklDnnEnabled(); + } + private int activationToArg(IActivation a){ //0=tanh, 1=relu, 2=sigmoid, 3=affine, 4=leaky relu, 5= thresholded relu, 6=scaled tanh, 7=hard sigmoid, 8=ELU, 9=softsign, 10=softplus if(a instanceof ActivationTanH) diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLocalResponseNormalizationHelper.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLocalResponseNormalizationHelper.java index d0c9f90ad..c38a81b58 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLocalResponseNormalizationHelper.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/mkldnn/MKLDNNLocalResponseNormalizationHelper.java @@ -94,4 +94,5 @@ public class MKLDNNLocalResponseNormalizationHelper extends BaseMKLDNNHelper imp public Map helperMemoryUse() { return Collections.emptyMap(); } + } diff --git a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/recurrent/BidirectionalLayer.java b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/recurrent/BidirectionalLayer.java index a33baf754..3d2784fa5 100644 --- a/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/recurrent/BidirectionalLayer.java +++ b/cavis-dnn/cavis-dnn-nn/src/main/java/org/deeplearning4j/nn/layers/recurrent/BidirectionalLayer.java @@ -592,6 +592,11 @@ public class BidirectionalLayer implements RecurrentLayer { } return ret; } + + @Override + public boolean checkSupported() { + return true; + } } @Override diff --git a/cavis-dnn/cavis-dnn-nn/src/test/java/org/deeplearning4j/nn/layers/HelperUtilsTest.java b/cavis-dnn/cavis-dnn-nn/src/test/java/org/deeplearning4j/nn/layers/HelperUtilsTest.java index 0f034301c..bd05f187f 100644 --- a/cavis-dnn/cavis-dnn-nn/src/test/java/org/deeplearning4j/nn/layers/HelperUtilsTest.java +++ b/cavis-dnn/cavis-dnn-nn/src/test/java/org/deeplearning4j/nn/layers/HelperUtilsTest.java @@ -20,50 +20,21 @@ package org.deeplearning4j.nn.layers; import org.deeplearning4j.BaseDL4JTest; -import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator; -import org.deeplearning4j.nn.api.OptimizationAlgorithm; -import org.deeplearning4j.nn.conf.ComputationGraphConfiguration; -import org.deeplearning4j.nn.conf.MultiLayerConfiguration; -import org.deeplearning4j.nn.conf.NeuralNetConfiguration; -import org.deeplearning4j.nn.conf.inputs.InputType; -import org.deeplearning4j.nn.conf.layers.ActivationLayer; -import org.deeplearning4j.nn.conf.layers.OutputLayer; -import org.deeplearning4j.nn.conf.layers.*; -import org.deeplearning4j.nn.graph.ComputationGraph; import org.deeplearning4j.nn.layers.convolution.ConvolutionHelper; import org.deeplearning4j.nn.layers.convolution.subsampling.SubsamplingHelper; import org.deeplearning4j.nn.layers.mkldnn.*; import org.deeplearning4j.nn.layers.normalization.BatchNormalizationHelper; import org.deeplearning4j.nn.layers.normalization.LocalResponseNormalizationHelper; import org.deeplearning4j.nn.layers.recurrent.LSTMHelper; -import org.deeplearning4j.nn.multilayer.MultiLayerNetwork; -import org.deeplearning4j.nn.weights.WeightInit; import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.nd4j.common.tests.tags.NativeTag; -import org.nd4j.common.tests.tags.TagNames; -import org.nd4j.linalg.activations.Activation; -import org.nd4j.linalg.activations.impl.ActivationELU; -import org.nd4j.linalg.activations.impl.ActivationRationalTanh; -import org.nd4j.linalg.activations.impl.ActivationSoftmax; import org.nd4j.linalg.api.buffer.DataType; -import org.nd4j.linalg.api.ndarray.INDArray; -import org.nd4j.linalg.dataset.DataSet; -import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; -import org.nd4j.linalg.factory.Nd4j; -import org.nd4j.linalg.lossfunctions.LossFunctions; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** */ @DisplayName("Activation Layer Test") -@NativeTag -@Tag(TagNames.CUSTOM_FUNCTIONALITY) -@Tag(TagNames.DL4J_OLD_API) public class HelperUtilsTest extends BaseDL4JTest { @Override diff --git a/settings.gradle b/settings.gradle index d6355b295..2e4e68cce 100644 --- a/settings.gradle +++ b/settings.gradle @@ -116,8 +116,8 @@ include ':cavis-dnn:cavis-dnn-spark:cavis-dnn-spark-parameterserver' include ':cavis-dnn:cavis-dnn-tsne' include ':cavis-datavec' include ':cavis-datavec:cavis-datavec-api' -include ':cavis-datavec:cavis-datavec-arrow' include ':cavis-datavec:cavis-datavec-data' +include ':cavis-datavec:cavis-datavec-data:cavis-datavec-data-arrow' include ':cavis-datavec:cavis-datavec-data:cavis-datavec-data-image' include ':cavis-datavec:cavis-datavec-data:cavis-datavec-data-audio' include ':cavis-datavec:cavis-datavec-data:cavis-datavec-data-codec'