Skip to content

Commit ece6586

Browse files
authored
bugfix inspectorscripts.ts pytorch (#187)
1 parent 8527998 commit ece6586

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/inspectorscripts.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ __ipywidgets = None
3535
def _check_imported():
3636
global __np, __pd, __pyspark, __tf, __K, __torch, __ipywidgets
3737
38-
if '
39-
' in sys.modules:
38+
if 'numpy' in sys.modules:
4039
# don't really need the try
4140
import numpy as __np
4241
@@ -211,7 +210,7 @@ def _jupyterlab_variableinspector_getmatrixcontent(x, max_rows=10000):
211210
elif __tf and (isinstance(x, __tf.Variable) or isinstance(x, __tf.Tensor)):
212211
df = __K.get_value(x)
213212
return _jupyterlab_variableinspector_getmatrixcontent(df)
214-
elif __torch and __pd and isinstance(x, torch.Tensor):
213+
elif __torch and isinstance(x, __torch.Tensor):
215214
df = x.cpu().numpy()
216215
return _jupyterlab_variableinspector_getmatrixcontent(df)
217216
elif isinstance(x, list):

0 commit comments

Comments
 (0)