Basic bayesian inference formulation

In the first case, you’re providing a prior distribution with fixed parameters, whereas in the latter you’re providing distributions over the parameters as well, which means they can be learned and changed; though I believe the latter case should be

with pm.Model() as model:
    sd = pm.Normal(“sd”, mu=std)
    mu = pm.Normal(“mu”, mu=mean)
    prior = pm.Normal("prior", mu=mu, sd=sd)
    pm.Normal(“likelihood”, mu=prior, observed=data)

so that you’re providing both a prior distribution for the data and priors for both parameters (whereas the way you have it you’re providing a prior for the standard deviation, and a prior for the data, but not for the mean). Hope that helps