private boolean compare(Tensor from, Tensor to) {
int[] fromIndices = from.getIndices().getFreeIndices().getAllIndices().copy();
for (int i = 0; i < fromIndices.length; ++i)
fromIndices[i] = IndicesUtils.getNameWithType(fromIndices[i]);
OutputPortUnsafe<IndexMappingBuffer> provider = IndexMappings.createPort(new IndexMappingBufferTester(fromIndices, CC.withMetric()), from, to);
IndexMappingBuffer buffer;
if ((buffer = provider.take()) != null) {
buffer.removeContracted();
assert buffer.isEmpty();
return buffer.getSignum() == true;