Skip to content

Commit ff5d276

Browse files
committed
Add some notes, CC @junpenglao
1 parent cc8fd34 commit ff5d276

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pymc3/variational/opvi.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,23 @@ def _new_initial(self, size, deterministic, more_replacements=None):
962962
size : scalar
963963
sample size
964964
deterministic : bool or scalar
965-
whether sample in deterministic manner
965+
whether to sample in deterministic manner
966966
more_replacements : dict
967967
more replacements passed to shape
968968
969+
Notes
970+
-----
971+
Corner case explained
972+
973+
- suppose you have AEVB setup
974+
- `X` is purely symbolic
975+
- `X.shape[0]` is needed for `initial` second dim
976+
- for inference you replace `X` with data tensor
977+
- `X.shape[0]` in `initial` remains symbolic and can't be replaced
978+
- you get `MissingInputError`
979+
980+
Solution is to do manual replacements for second dim in `initial` here
981+
969982
Returns
970983
-------
971984
tensor

0 commit comments

Comments
 (0)