Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump opt_einsum to 2.3.2, remove patch #1660

Merged
merged 1 commit into from
Dec 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ cloudpickle>=0.3.1
graphviz>=0.8
networkx>=2.2
observations>=0.1.4
opt_einsum>=2.3.0
opt_einsum>=2.3.2
tqdm>=4.25
19 changes: 0 additions & 19 deletions pyro/distributions/torch_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import os

import opt_einsum
import torch

if 'READTHEDOCS' not in os.environ:
Expand Down Expand Up @@ -85,22 +84,4 @@ def _einsum(equation, *operands):
return _einsum._pyro_unpatched(equation, *operands)


# This can be removed after https://github.com/dgasmith/opt_einsum/pull/77 is released.
@patch_dependency('opt_einsum.helpers.compute_size_by_dict', opt_einsum)
def _compute_size_by_dict(indices, idx_dict):
if torch._C._get_tracing_state():
# If running under the jit, convert all sizes from tensors to ints, the
# first time each idx_dict is seen.
last_idx_dict = getattr(_compute_size_by_dict, '_last_idx_dict', None)
if idx_dict is not last_idx_dict:
_compute_size_by_dict._last_idx_dict = idx_dict
for key, value in idx_dict.items():
idx_dict[key] = int(value)

ret = 1
for i in indices:
ret *= idx_dict[i]
return ret


__all__ = []
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'graphviz>=0.8',
'networkx>=2.2',
'numpy>=1.7',
'opt_einsum>=2.3.0',
'opt_einsum>=2.3.2',
'six>=1.10.0',
'torch>=1.0.0',
'tqdm>=4.28',
Expand Down