def test_flatten_lower_triangle() -> None:
    """This tests code which turns the lower triangular entries tensor (that is, entries with
    i <= j for i and j indexing the last two dimensions) into a tensor flattened along the last
    two dimensions."""
    # Test the function with a (2, 2, 4, 4) tensor
    t = torch.arange(1, 65).reshape(2, 2, 4, 4)
    flattened_t = flatten_lower_triangle(t)
    expected_t = torch.tensor(
        [
            [[1, 5, 6, 9, 10, 11, 13, 14, 15, 16], [17, 21, 22, 25, 26, 27, 29, 30, 31, 32]],
            [[33, 37, 38, 41, 42, 43, 45, 46, 47, 48], [49, 53, 54, 57, 58, 59, 61, 62, 63, 64]],
        ],
        dtype=torch.int64,
    )
    assert flattened_t.shape == (2, 2, 10), f"Got shape {flattened_t.shape}, expected (2, 2, 10)"
    assert torch.allclose(
        flattened_t, expected_t
    ), "Flattened tensor values do not match expected values"

    # Test the function with a (3, 2, 2, 4, 4) tensor
    t = torch.arange(1, 33).reshape(2, 4, 4)
    flattened_t = flatten_lower_triangle(t)
    expected_t = torch.tensor(
        [[1, 5, 6, 9, 10, 11, 13, 14, 15, 16], [17, 21, 22, 25, 26, 27, 29, 30, 31, 32]],
        dtype=torch.int64,
    )
    assert flattened_t.shape == (2, 10), f"Got shape {flattened_t.shape}, expected (2, 2, 10)"
    assert torch.allclose(
        flattened_t, expected_t
    ), "Flattened tensor values do not match expected values"
This tests code which turns the lower triangular entries tensor (that is, entries with
    i <= j for i and j indexing the last two dimensions) into a tensor flattened along the last
    two dimensions.
neuron_explainer/activations/derived_scalars/tests/test_derived_scalar_types.py