throw new IllegalArgumentException();
indices = indices.getFree();
IndicesTypeStructure typeStructure = new IndicesTypeStructure(IndicesFactory.createSimple(null, indices));
List<NameDescriptor> descriptors = new ArrayList<>();
int totalIndicesCounts[] = new int[TYPES.length];
NameDescriptor nd;
int i;
for (i = 0; i < minProductSize; ++i) {
descriptors.add(nd = nextNameDescriptor());
for (byte b : TYPES) {
IndicesTypeStructure.TypeData typeData = nd.getIndicesTypeStructure().getTypeData(b);
if (typeData != null)
totalIndicesCounts[b] += typeData.length;
}
}
//if tensors are not not enough (product.indices.size < freeIndices.size)
for (byte b : TYPES) {
IndicesTypeStructure.TypeData typeData = typeStructure.getTypeData(b);
if (typeData == null)
continue;
while (totalIndicesCounts[b] < typeData.length) {
descriptors.add(nd = nextNameDescriptor());
for (byte bb : TYPES) {
IndicesTypeStructure.TypeData typeData1 = nd.getIndicesTypeStructure().getTypeData(bb);
if (typeData1 != null)
totalIndicesCounts[bb] += typeData1.length;
}
}
}