From c22b940a7e324ce4427e43d42c41be34acf8f538 Mon Sep 17 00:00:00 2001
From: Steve Schmerler <git@elcorto.com>
Date: Thu, 8 May 2025 13:46:58 +0200
Subject: [PATCH] gp: 02_two_dim: update sample syntax

---
 BLcourse2.3/02_two_dim.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BLcourse2.3/02_two_dim.py b/BLcourse2.3/02_two_dim.py
index 3489495..a02f4c8 100644
--- a/BLcourse2.3/02_two_dim.py
+++ b/BLcourse2.3/02_two_dim.py
@@ -136,7 +136,9 @@ if use_noise:
     # noisy train data
     noise_std = 0.2
     noise_dist = torch.distributions.Normal(loc=0, scale=noise_std)
-    y_train = data_train.z + noise_dist.sample_n(len(data_train.z))
+    y_train = data_train.z + noise_dist.sample(
+        sample_shape=(len(data_train.z),)
+    )
 else:
     # noise-free train data
     noise_std = 0
-- 
GitLab