def _make_test_data(shape, input_dtype):
    data = np.random.random_sample(shape)
    if ((data.ndim == 3) and (data.shape[(- 1)] == 4)):
        data[(..., (- 1))] = 1.0
    max_val = _max_for_dtype(input_dtype)
    if (max_val != 1):
        data *= max_val
    data = data.astype(input_dtype)
    return data
def _make_test_data(shape, input_dtype):
    data = np.random.random_sample(shape)
    if ((data.ndim == 3) and (data.shape[(- 1)] == 4)):
        data[(..., (- 1))] = 1.0
    max_val = _max_for_dtype(input_dtype)
    if (max_val != 1):
        data *= max_val
    data = data.astype(input_dtype)
    return data