Tensor2dSize includes multiple summations
@@ -361,15 +361,15 @@ class SolutionWriter:
s += "%suint64_t tensor2dSizeAOffset = 0;\n" % t
numIdx = len(problemType["IndexAssignmentsA"])
- printMe = printedSum = False
+ printMe = False
for i in range(0,numIdx):
idx = problemType["IndexAssignmentsA"][i]
- # Multiply only by first free and first summation
+ # Don't multiple batch dimensions that will be backed into SRD:
if idx in [ord(x)-ord(globalParameters["IndexChars"][0]) for x in solution["PackedC0Indices"]]:
printMe = True
- elif idx in problemType["IndicesSummation"] and not printedSum:
- printMe = printedSum = True
+ elif idx in problemType["IndicesSummation"]:
+ printMe = True
else:
printMe = False
@@ -391,15 +391,15 @@ class SolutionWriter:
s += "%suint64_t tensor2dSizeBStride = 0;\n" % t
s += "%suint64_t tensor2dSizeBOffset = 0;\n" % t
numIdx = len(problemType["IndexAssignmentsB"])
- printMe = printedSum = False
+ printMe = False
for i in range(0,numIdx):
idx = problemType["IndexAssignmentsB"][i]
# Multiply only by first free and first summation
if idx in [ord(x)-ord(globalParameters["IndexChars"][0]) for x in solution["PackedC1Indices"]]:
printMe = True
- elif idx in problemType["IndicesSummation"] and not printedSum:
- printMe = printedSum = True
+ elif idx in problemType["IndicesSummation"]:
+ printMe = True
else:
printMe = False
