Skip to content

Commit 585591b

Browse files
yueqiwtensorflow-copybara
authored andcommitted
Fix the import statements in neural_clustering, such that neural_clustering is imported as a standalone module outside NSL.
PiperOrigin-RevId: 353685620
1 parent 51d0415 commit 585591b

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

research/neural_clustering/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414
"""Neural Clustering."""
1515

16-
from neural_structured_learning.research.neural_clustering import data_generators
17-
from neural_structured_learning.research.neural_clustering import models
18-
from neural_structured_learning.research.neural_clustering import utils
16+
from neural_clustering import data_generators
17+
from neural_clustering import models
18+
from neural_clustering import utils
1919

2020
__all__ = ["data_generators", "models", "utils"]

research/neural_clustering/data_generators/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Data generators for neural clustering."""
1515

16-
from neural_structured_learning.research.neural_clustering.data_generators.mog import MOGGenerator
17-
from neural_structured_learning.research.neural_clustering.data_generators.partition import CRPGenerator
16+
from neural_clustering.data_generators.mog import MOGGenerator
17+
from neural_clustering.data_generators.partition import CRPGenerator
1818

1919
__all__ = ["CRPGenerator", "MOGGenerator"]

research/neural_clustering/data_generators/mog_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from absl.testing import absltest
1717
from absl.testing import parameterized
18-
from neural_structured_learning.research.neural_clustering.data_generators import mog
18+
from neural_clustering.data_generators import mog
1919
import numpy as np
2020

2121

research/neural_clustering/data_generators/partition_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from absl.testing import absltest
1717
from absl.testing import parameterized
18-
from neural_structured_learning.research.neural_clustering.data_generators import partition
18+
from neural_clustering.data_generators import partition
1919
import numpy as np
2020

2121

research/neural_clustering/models/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
# limitations under the License.
1414
"""Keras API for neural clustering models."""
1515

16-
from neural_structured_learning.research.neural_clustering.models.ncp_base import NCPBase
17-
from neural_structured_learning.research.neural_clustering.models.ncp_models import NCPWithMLP
18-
from neural_structured_learning.research.neural_clustering.models.ncp_wrapper import CategoricalSampler
19-
from neural_structured_learning.research.neural_clustering.models.ncp_wrapper import GreedySampler
20-
from neural_structured_learning.research.neural_clustering.models.ncp_wrapper import NCPWrapper
16+
from neural_clustering.models.ncp_base import NCPBase
17+
from neural_clustering.models.ncp_models import NCPWithMLP
18+
from neural_clustering.models.ncp_wrapper import CategoricalSampler
19+
from neural_clustering.models.ncp_wrapper import GreedySampler
20+
from neural_clustering.models.ncp_wrapper import NCPWrapper
2121

2222
__all__ = [
2323
'NCPBase', 'NCPWithMLP', 'NCPWrapper', 'GreedySampler', 'CategoricalSampler'

research/neural_clustering/models/ncp_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Neural Clustering Process models with concrete neural network layers."""
1515

16-
from neural_structured_learning.research.neural_clustering.models.ncp_base import NCPBase
16+
from neural_clustering.models.ncp_base import NCPBase
1717
import tensorflow as tf
1818

1919

research/neural_clustering/models/ncp_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""Tests for neural_structured_learning.research.neural_clustering.models.ncp."""
1515

1616
from absl.testing import parameterized
17-
from neural_structured_learning.research.neural_clustering import models
17+
from neural_clustering import models
1818
import numpy as np
1919
import tensorflow as tf
2020

research/neural_clustering/models/ncp_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""NCP model wrapper and cluster samplers."""
1515

16-
from neural_structured_learning.research.neural_clustering.utils.data_utils import batch_remap_label_ids
16+
from neural_clustering.utils.data_utils import batch_remap_label_ids
1717
import tensorflow as tf
1818

1919

research/neural_clustering/utils/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Utility functions for neural clustering."""
1515

16-
from neural_structured_learning.research.neural_clustering.utils.data_utils import batch_remap_label_ids
17-
from neural_structured_learning.research.neural_clustering.utils.data_utils import remap_label_ids
16+
from neural_clustering.utils.data_utils import batch_remap_label_ids
17+
from neural_clustering.utils.data_utils import remap_label_ids
1818

1919
__all__ = ["batch_remap_label_ids", "remap_label_ids"]

research/neural_clustering/utils/data_utils_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from absl.testing import absltest
1717
from absl.testing import parameterized
18-
from neural_structured_learning.research.neural_clustering.utils import data_utils
18+
from neural_clustering.utils import data_utils
1919
import numpy as np
2020

2121

0 commit comments

Comments
 (0)