@@ -12,41 +12,41 @@ public TensorShape(int[] shape) {
12
12
this .shape = shape ;
13
13
}
14
14
15
- public TensorShape (String shape ) {
16
- this .shape = getShapeFromString (shape );
17
- }
15
+ // public TensorShape(String shape) {
16
+ // this.shape = getShapeFromString(shape);
17
+ // }
18
18
19
19
public TensorShape (long [] shape ) {
20
20
this .shape = Arrays .stream (shape )
21
21
.mapToInt (x -> (int ) x )
22
22
.toArray ();
23
23
}
24
24
25
- /**
26
- * Extract a shape from a string like (?, 2, 2)
27
- */
28
- private static int [] getShapeFromString (String stringShape ) {
29
- String removeParenthesis = stringShape .substring (1 , stringShape .length () - 1 );
30
- String [] split = removeParenthesis .split ("," );
31
-
32
- if (removeParenthesis .isEmpty ()) {
33
- return new int [0 ];
34
- }
35
-
36
- Integer [] result = Arrays
37
- .stream (split )
38
- .map (String ::trim )
39
- .map (x -> {
40
- if ("?" .equals (x )) {
41
- return -1 ;
42
- } else {
43
- return Integer .parseInt (x );
44
- }
45
- })
46
- .toArray (Integer []::new );
47
-
48
- return ArrayUtils .toPrimitive (result );
49
- }
25
+ // /**
26
+ // * Extract a shape from a string like (?, 2, 2)
27
+ // */
28
+ // private static int[] getShapeFromString(String stringShape) {
29
+ // String removeParenthesis = stringShape.substring(1, stringShape.length() - 1);
30
+ // String[] split = removeParenthesis.split(",");
31
+ //
32
+ // if (removeParenthesis.isEmpty()) {
33
+ // return new int[0];
34
+ // }
35
+ //
36
+ // Integer[] result = Arrays
37
+ // .stream(split)
38
+ // .map(String::trim)
39
+ // .map(x -> {
40
+ // if ("?".equals(x)) {
41
+ // return -1;
42
+ // } else {
43
+ // return Integer.parseInt(x);
44
+ // }
45
+ // })
46
+ // .toArray(Integer[]::new);
47
+ //
48
+ // return ArrayUtils.toPrimitive(result);
49
+ // }
50
50
51
51
public boolean handleBatch () {
52
52
return shape .length != 0 && shape [0 ] == -1 ;
0 commit comments