Skip to content

Commit 7ebc9ae

Browse files
authored
Basic clean up of typescript flatbuffers + small test run for backwards compatibility (#10192)
1 parent 1dd8f4b commit 7ebc9ae

File tree

14 files changed

+213
-1050
lines changed

14 files changed

+213
-1050
lines changed

deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
<!-- For SameDiff UI -->
311311
<dependency>
312312
<groupId>org.nd4j</groupId>
313-
<artifactId>nd4j-web</artifactId>
313+
<artifactId>nd4j-webjar</artifactId>
314314
<version>${project.version}</version>
315315
</dependency>
316316
</dependencies>

nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/executioner/DefaultOpExecutioner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ public DataBuffer createConstantBuffer(double[] values, DataType desiredType) {
10611061

10621062

10631063
public INDArray getX(Op op, OpContext oc) {
1064-
if( oc != null )
1064+
if( oc != null)
10651065
return oc.getInputArray(0);
10661066
return op.x();
10671067
}

nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/nativeblas/OpaqueNDArray.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ public static OpaqueNDArray fromINDArrayUncached(INDArray array) {
209209
* @return The corresponding OpaqueNDArray.
210210
*/
211211
public static OpaqueNDArray fromINDArray(INDArray array) {
212+
if(array == null) {
213+
return null;
214+
}
212215
return array.getOrCreateOpaqueNDArray();
213216
}
214217

nd4j/nd4j-web/nd4j-webjar/package-lock.json

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@eclipse/nd4j-webjar",
3+
"version": "${project.version}",
4+
"description": "WebJar for ND4J Flatbuffer bindings",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"scripts": {
8+
"build": "tsc",
9+
"prepare": "npm run build"
10+
},
11+
"devDependencies": {
12+
"typescript": "^4.9.0",
13+
"flatbuffers": "^23.5.26"
14+
},
15+
"license": "Apache-2.0"
16+
}

nd4j/nd4j-web/nd4j-webjar/pom.xml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ /* ******************************************************************************
4+
~ *
5+
~ *
6+
~ * This program and the accompanying materials are made available under the
7+
~ * terms of the Apache License, Version 2.0 which is available at
8+
~ * https://www.apache.org/licenses/LICENSE-2.0.
9+
~ *
10+
~ * See the NOTICE file distributed with this work for additional
11+
~ * information regarding copyright ownership.
12+
~ * Unless required by applicable law or agreed to in writing, software
13+
~ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
~ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15+
~ * License for the specific language governing permissions and limitations
16+
~ * under the License.
17+
~ *
18+
~ * SPDX-License-Identifier: Apache-2.0
19+
~ ******************************************************************************/
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0"
23+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25+
<parent>
26+
<artifactId>nd4j-web</artifactId>
27+
<groupId>org.nd4j</groupId>
28+
<version>1.0.0-SNAPSHOT</version>
29+
</parent>
30+
<modelVersion>4.0.0</modelVersion>
31+
32+
<artifactId>nd4j-webjar</artifactId>
33+
<packaging>jar</packaging>
34+
35+
<properties>
36+
<frontend.maven.plugin.version>1.12.1</frontend.maven.plugin.version>
37+
<node.version>v16.13.0</node.version>
38+
<npm.version>8.1.0</npm.version>
39+
</properties>
40+
41+
<build>
42+
<plugins>
43+
<plugin>
44+
<groupId>com.github.eirslett</groupId>
45+
<artifactId>frontend-maven-plugin</artifactId>
46+
<version>${frontend.maven.plugin.version}</version>
47+
<configuration>
48+
<nodeVersion>${node.version}</nodeVersion>
49+
<npmVersion>${npm.version}</npmVersion>
50+
<workingDirectory>${project.basedir}</workingDirectory>
51+
</configuration>
52+
<executions>
53+
<execution>
54+
<id>install node and npm</id>
55+
<goals>
56+
<goal>install-node-and-npm</goal>
57+
</goals>
58+
</execution>
59+
<execution>
60+
<id>npm install</id>
61+
<goals>
62+
<goal>npm</goal>
63+
</goals>
64+
<phase>generate-resources</phase>
65+
<configuration>
66+
<arguments>install</arguments>
67+
</configuration>
68+
</execution>
69+
<execution>
70+
<id>npm run build</id>
71+
<goals>
72+
<goal>npm</goal>
73+
</goals>
74+
<phase>generate-resources</phase>
75+
<configuration>
76+
<arguments>run build</arguments>
77+
</configuration>
78+
</execution>
79+
</executions>
80+
</plugin>
81+
</plugins>
82+
</build>
83+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "commonjs",
5+
"declaration": true,
6+
"outDir": "./dist",
7+
"strict": true,
8+
"esModuleInterop": true,
9+
"skipLibCheck": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"lib": [
12+
"dom",
13+
"es5",
14+
"scripthost",
15+
"es2020.bigint"
16+
]
17+
},
18+
"include": ["src"],
19+
"exclude": ["node_modules", "dist"]
20+
}

nd4j/nd4j-web/pom.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ /* ******************************************************************************
4+
~ *
5+
~ *
6+
~ * This program and the accompanying materials are made available under the
7+
~ * terms of the Apache License, Version 2.0 which is available at
8+
~ * https://www.apache.org/licenses/LICENSE-2.0.
9+
~ *
10+
~ * See the NOTICE file distributed with this work for additional
11+
~ * information regarding copyright ownership.
12+
~ * Unless required by applicable law or agreed to in writing, software
13+
~ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
~ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15+
~ * License for the specific language governing permissions and limitations
16+
~ * under the License.
17+
~ *
18+
~ * SPDX-License-Identifier: Apache-2.0
19+
~ ******************************************************************************/
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0"
23+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25+
<parent>
26+
<artifactId>nd4j</artifactId>
27+
<groupId>org.nd4j</groupId>
28+
<version>1.0.0-SNAPSHOT</version>
29+
</parent>
30+
<modelVersion>4.0.0</modelVersion>
31+
32+
<artifactId>nd4j-web</artifactId>
33+
<packaging>pom</packaging>
34+
35+
<modules>
36+
<module>nd4j-webjar</module>
37+
</modules>
38+
39+
</project>

platform-tests/src/test/java/org/deeplearning4j/ui/ui/TestSameDiffUI.java

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)