Skip to content

Commit 99a1f8a

Browse files
Balandatfacebook-github-bot
authored andcommitted
Fix Multi-Task GP example in docstring (pytorch#447)
Summary: Addresses pytorch#446 Pull Request resolved: pytorch#447 Reviewed By: qingfeng10 Differential Revision: D21594459 Pulled By: Balandat fbshipit-source-id: a3b4d14791175ef67ca28e8d9582e13cc37ab083
1 parent 8ca4ac2 commit 99a1f8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

botorch/models/multitask.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ def __init__(
6868
Example:
6969
>>> X1, X2 = torch.rand(10, 2), torch.rand(20, 2)
7070
>>> i1, i2 = torch.zeros(10, 1), torch.ones(20, 1)
71-
>>> train_X = torch.stack([
71+
>>> train_X = torch.cat([
7272
>>> torch.cat([X1, i1], -1), torch.cat([X2, i2], -1),
7373
>>> ])
74-
>>> train_Y = torch.cat(f1(X1), f2(X2))
74+
>>> train_Y = torch.cat(f1(X1), f2(X2)).unsqueeze(-1)
7575
>>> model = MultiTaskGP(train_X, train_Y, task_feature=-1)
7676
"""
7777
self._validate_tensor_args(X=train_X, Y=train_Y)

0 commit comments

Comments
 (0)