Data Transformation

Some handy generic transformations

source

ListToTensor

 ListToTensor (enc=None, dec=None, split_idx=None, order=None)

A transform with a __repr__ that shows its attrs

t = ListToTensor()
x = [1, 2]
test_eq(t(x), tensor([1, 2]))
test_eq(t.decode(t(x)), [tensor(1),tensor(2)])