Converts a set or algebraic structure to a tensor.
The set or structure
The size of the tensor
const set = Chalkboard.abal.set([1, 2, 3, 4]);const tensor = Chalkboard.abal.toTensor(set, 2, 2); // Returns [[1, 2], [3, 4]] Copy
const set = Chalkboard.abal.set([1, 2, 3, 4]);const tensor = Chalkboard.abal.toTensor(set, 2, 2); // Returns [[1, 2], [3, 4]]
Converts a set or algebraic structure to a tensor.