function sliceArraysByIndices(arrays, indices) {
	  return tidy(function () {
	    if (arrays == null) {
	      return null;
	    } else if (Array.isArray(arrays)) {
	      return arrays.map(function (array) {
	        return sliceArraysByIndices(array, indices);
	      });
	    } else {
	      // TODO(cais): indices should be a pre-constructed Tensor1D to avoid
	      //   tensor1d() calls.
	      return gather$1(arrays, indices.dtype === 'int32' ? indices : indices.toInt());
	    }
	  });
	}
Slice a Tensor or an Array of Tensors, by random-order indices.

Porting Note: The `_slice_arrays` function in PyKeras is covered by this
  function and `sliceArrays()` together.

@param arrays The input `tf.Tensor` or `Array` of `tf.Tensor`s to slice.
  If an `Array` of `tf.Tensor`s, all `tf.Tensor`s will be sliced in the
  same fashion.
@param indices The indices to use for slicing along the first (batch)
  dimension.
@returns Result(s) of the slicing.