def test_embedder_raising_overhead():
    """Tests that embedding to the output layer of a 3 layer model takes less than 10ms more than the time taken to
    execute the model without the embedder.

    Note that this bound is intentionally high in an effort to reduce the flakiness of the test.

    """
    model = NLayerModel(10)
    embedder = Embedder(model, "output")

    start = time.perf_counter()
    model.predict_step(torch.rand(10, 1000), 0, 0)
    end = time.perf_counter()

    model_time = end - start

    start = time.perf_counter()
    embedder.predict_step(torch.rand(10, 1000), 0, 0)
    end = time.perf_counter()

    embedder_time = end - start

    assert abs(embedder_time - model_time) < 0.05
Tests that embedding to the output layer of a 3 layer model takes less than 10ms more than the time taken to
    execute the model without the embedder.

    Note that this bound is intentionally high in an effort to reduce the flakiness of the test.

    
tests/core/utilities/test_embedder.py