alibaba / graph-learn

An Industrial Graph Neural Network Framework
Apache License 2.0
1.28k stars 267 forks source link

Enables tensorflow 2 compatibility. #233

Closed sighingnow closed 1 year ago

sighingnow commented 1 year ago

Translate import tensorflow to

try:
  # https://www.tensorflow.org/guide/migrate
  import tensorflow.compat.v1 as tf
  tf.disable_v2_behavior()
except ImportError:
  import tensorflow as tf