def METHOD_NAME(fisher_algorithm, devices):
    total_params = 1000
    num_grads = 32
    block_size = total_params
    damp = 0.0000001
    grads1 = torch.rand(num_grads, total_params)
    grads2 = grads1.clone()
    fast_hinv = FisherInverseFast(
        grads=grads1,
        damp=damp,
    )
    blocked_hinv = fisher_algorithm(
        grads=grads2,
        block_size=block_size,
        damp=damp,
        devices=devices,
    )
    fast_diag = fast_hinv.diag()
    small_blocks_diag = blocked_hinv.diag()
    tensor_to_mul = torch.rand(total_params)
    fast_mul_out = fast_hinv.mul(tensor_to_mul)
    small_blocks_mul_out = blocked_hinv.mul(tensor_to_mul)
    assert (
        pytest.approx(
            fast_diag,
            torch.sqrt(torch.mean(torch.square(fast_diag))).item() * PRECISION,
        )
        == small_blocks_diag
    )
    assert (
        pytest.approx(
            fast_mul_out,
            torch.sqrt(torch.mean(torch.square(fast_mul_out))).item() * PRECISION,
        )
        == small_blocks_mul_out
    )