Skip to content

Commit

Permalink
exaple fix for old torch
Browse files Browse the repository at this point in the history
  • Loading branch information
rhandal-pfn committed Aug 27, 2024
1 parent 703f0d8 commit b6a5e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pfhedge/instruments/primary/kou_jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class KouJumpStock(BasePrimary):
>>> stock = KouJumpStock(device = torch.device('cpu'))
>>> stock.simulate(n_paths=2, time_horizon=5 / 250)
>>> stock.spot
tensor([[1.0000, 1.0018, 1.0084, 1.0150, 1.0044, 1.0056],
tensor([[1.0000, 0.9868, 0.9934, 0.9999, 0.9893, 0.9906],
[1.0000, 0.9956, 1.0050, 1.0121, 1.0227, 1.0369]])
>>> stock.variance
tensor([[0.0400, 0.0400, 0.0400, 0.0400, 0.0400, 0.0400],
Expand Down
2 changes: 1 addition & 1 deletion pfhedge/stochastic/kou_jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def generate_kou_jump(
>>>
>>> _ = torch.manual_seed(42)
>>> generate_kou_jump(2, 5, device = torch.device('cpu'))
tensor([[1.0000, 1.0053, 1.0119, 0.9271, 0.9174],
tensor([[1.0000, 1.0053, 1.0119, 0.9993, 0.9887],
[1.0000, 1.0321, 1.0275, 1.0372, 1.0445]])
"""
assert jump_eta_up > 1.0, "jump_eta_up must be larger than 1.0"
Expand Down

0 comments on commit b6a5e54

Please sign in to comment.