def _get_autoencoder_test_path_maybe_saving_new_autoencoder(
    dst: DerivedScalarType,
    model_context: ModelContext,
) -> str:
    """Return the path to a test autoencoder. If the autoencoder does not exist, create it."""

    autoencoder_path = get_autoencoder_test_path(dst)

    if file_exists(autoencoder_path):
        return autoencoder_path

    # create autoencoder
    activation_shape = get_activation_shape(dst, model_context)
    input_tensor = torch.zeros(activation_shape)
    reshape_fn = make_reshape_fn(dst)
    reshaped_input_tensor = reshape_fn(input_tensor)
    print(f"autoencoder_input_tensor.shape: {reshaped_input_tensor.shape}")
    n_inputs = reshaped_input_tensor.shape[1]
    n_latents = 6
    autoencoder = Autoencoder(n_latents, n_inputs)
    print({autoencoder.pre_bias.shape})

    # change bias to have non-zero latent activations, to have non-zero gradients in test
    autoencoder.latent_bias.data[:] = 100.0

    # save autoencoder
    with CustomFileHandler(autoencoder_path, "wb") as f:
        print(f"Saving autoencoder to {autoencoder_path}")
        torch.save(autoencoder.state_dict(), f)

    return autoencoder_path
Return the path to a test autoencoder. If the autoencoder does not exist, create it.
neuron_explainer/activations/derived_scalars/tests/test_derived_scalar_types.py