def as_empty_parameter(self) -> Parameter[T]:
    """Creates a placeholder parameter containing `jax.ShapeDtypeStruct` leaves.

    This can be used to create a model with the right PyTree structure without
    actually initializing the parameters; this is useful for restoring a model
    from a checkpoint, for instance.

    Returns:
      A new instance of Parameter, but with empty `jax.ShapeDtypeStruct` leaves
      instead of initialized arrays.
    """

    placeholder_value = (
        selectors.select(self.value_structure)
        .at_instances_of(shapecheck.ArraySpec)
        .apply(lambda s: s.into_pytree())
    )
    return Parameter(placeholder_value, self.name)
Creates a placeholder parameter containing `jax.ShapeDtypeStruct` leaves.

    This can be used to create a model with the right PyTree structure without
    actually initializing the parameters; this is useful for restoring a model
    from a checkpoint, for instance.

    Returns:
      A new instance of Parameter, but with empty `jax.ShapeDtypeStruct` leaves
      instead of initialized arrays.
    
penzai/deprecated/v1/nn/parameters.py