Meta-trained agents implement Bayes-optimal agents