mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[pycharm] PY-73352 Add import error handling + fix error displaying
GitOrigin-RevId: 8ec269d167132e7b5b2401df78eac82f282078bb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b648d99bec
commit
2c178f739f
@@ -413,8 +413,11 @@ def tensor_to_thrift_struct(tensor, name, roffset, coffset, rows, cols, format):
|
||||
|
||||
|
||||
def sparse_tensor_to_thrift_struct(tensor, name, roffset, coffset, rows, cols, format):
|
||||
import tensorflow as tf
|
||||
return tensor_to_thrift_struct(tf.sparse.to_dense(tf.sparse.reorder(tensor)), name, roffset, coffset, rows, cols, format)
|
||||
try:
|
||||
import tensorflow as tf
|
||||
return tensor_to_thrift_struct(tf.sparse.to_dense(tf.sparse.reorder(tensor)), name, roffset, coffset, rows, cols, format)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def array_to_meta_thrift_struct(array, name, format):
|
||||
|
||||
@@ -587,8 +587,11 @@ def tensor_to_xml(tensor, name, roffset, coffset, rows, cols, format):
|
||||
|
||||
|
||||
def sparse_tensor_to_xml(tensor, name, roffset, coffset, rows, cols, format):
|
||||
import tensorflow as tf
|
||||
return tensor_to_xml(tf.sparse.to_dense(tf.sparse.reorder(tensor)), name, roffset, coffset, rows, cols, format)
|
||||
try:
|
||||
import tensorflow as tf
|
||||
return tensor_to_xml(tf.sparse.to_dense(tf.sparse.reorder(tensor)), name, roffset, coffset, rows, cols, format)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class ExceedingArrayDimensionsException(Exception):
|
||||
|
||||
@@ -224,6 +224,8 @@ def _create_table(command, start_index=None, end_index=None):
|
||||
import tensorflow as tf
|
||||
if isinstance(command, tf.SparseTensor):
|
||||
command = tf.sparse.to_dense(tf.sparse.reorder(command))
|
||||
except ImportError:
|
||||
pass
|
||||
finally:
|
||||
np_array = command
|
||||
|
||||
|
||||
Reference in New Issue
Block a user