ToArray#
- class bayesflow.adapters.transforms.ToArray[source]#
Bases:
ElementwiseTransform
Checks provided data for any non-arrays and converts them to numpy arrays.
This ensures all data is in a format suitable for training.
Examples
>>> ta = bf.adapters.transforms.ToArray() >>> a = [1, 2, 3, 4] >>> ta.forward(a) array([1, 2, 3, 4]) >>> b = [[1, 2], [3, 4]] >>> ta.forward(b) array([[1, 2], [3, 4]])