getFirstAxisWithSizeGreaterThanOne static method
Implementation
static int getFirstAxisWithSizeGreaterThanOne(TensorBuffer tensorBuffer) {
List<int> shape = tensorBuffer.getShape();
for (int i = 0; i < shape.length; i++) {
if (shape[i] > 1) {
return i;
}
}
throw new ArgumentError(
"Cannot find an axis to label. A valid axis to label should have size larger than 1.");
}