ray.rllib.utils.numpy.concat_aligned#
- ray.rllib.utils.numpy.concat_aligned(items: List[numpy.ndarray], time_major: bool | None = None) numpy.ndarray[source]#
Concatenate arrays, ensuring the output is 64-byte aligned.
We only align float arrays; other arrays are concatenated as normal.
This should be used instead of np.concatenate() to improve performance when the output array is likely to be fed into TensorFlow.
- Parameters:
items – The list of items to concatenate and align.
time_major – Whether the data in items is time-major, in which case, we will concatenate along axis=1.
- Returns:
The concat’d and aligned array.