I need a data strucuture that is a 2-dimensional array of lists of pairs. That is, if subdata = data[i][j]
, then subdata
is a dynamic data structure that contains tuples of size 2.
My take on solving this was to use a Tensor
for the 2-D data structure, an InlinedFixedVector
for the flexible part, and a StaticTuple
for the pair.
from tensor import Tensor
from collections import InlinedFixedVector
from utils import StaticTuple
struct MyStruct:
var data: Tensor[InlinedFixedVector[StaticTuple[Float64, 2], 10]]
However, I get the following error:
'Tensor' parameter #0 has 'DType' type, but value has type 'AnyStruct[InlinedFixedVector[StaticTuple[SIMD[float64, 1], 2], 10]]'
Can Tensors only hold trivial data types? If so, is there a good general data structure for multi-dimensional data?