Pymc3 migration - Sharpe Ratio Example

Welcome!

I think you just need to import the tensor functionality:

import pytensor.tensor as pt

and then use the mean() and std() functions:

sharpe = pt.mean(returns) / pt.std(returns) * np.sqrt(252)