Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
use tensorflow.compat.v1
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhe committed Oct 10, 2019
1 parent 3065920 commit 97a4ed9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
import tensorflow as tf
import tensorflow.compat.v1 as tf
from .compressor import Pruner

__all__ = [ 'LevelPruner', 'AGP_Pruner', 'SensitivityPruner' ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
import tensorflow as tf
import tensorflow.compat.v1 as tf
from .compressor import Quantizer

__all__ = [ 'NaiveQuantizer', 'QAT_Quantizer', 'DoReFaQuantizer' ]
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/pynni/nni/compression/tensorflow/compressor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tensorflow as tf
import tensorflow.compat.v1 as tf
import logging
from . import default_layers

Expand Down
4 changes: 3 additions & 1 deletion src/sdk/pynni/tests/test_compressor.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from unittest import TestCase, main
import tensorflow as tf
import tensorflow.compat.v1 as tf
import torch
import torch.nn.functional as F
import nni.compression.tensorflow as tf_compressor
import nni.compression.torch as torch_compressor

tf.disable_v2_behavior()

def weight_variable(shape):
return tf.Variable(tf.truncated_normal(shape, stddev = 0.1))

Expand Down

0 comments on commit 97a4ed9

Please sign in to comment.