Skip to content

Commit e5cd24a

Browse files
Explicitly specify full package for more modules, as shown in #2001 (#2077)
* Test to demonstrate failures in import * Explicitly specify full package for more modules, as shown in #2001
1 parent baa0ad6 commit e5cd24a

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

keras_cv/datasets/imagenet/load.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def apply(example):
5656
return apply
5757

5858

59-
@keras_cv_export("keras_cv.datasets.imagenet.load")
59+
@keras_cv_export(
60+
"keras_cv.datasets.imagenet.load", package="keras_cv.datasets.imagenet"
61+
)
6062
def load(
6163
split,
6264
tfrecord_path,

keras_cv/datasets/load_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2023 The KerasCV Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Tests ability to load keras_cv.datasets."""
15+
16+
from keras_cv.tests.test_case import TestCase
17+
18+
19+
class LoadTest(TestCase):
20+
def test_datasets_load(self):
21+
import keras_cv.datasets # noqa: F401
22+
23+
def test_imagenet_load(self):
24+
import keras_cv.datasets.imagenet # noqa: F401

keras_cv/datasets/pascal_voc/segmentation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,10 @@ def md_gen():
465465
return dataset
466466

467467

468-
@keras_cv_export("keras_cv.datasets.pascal_voc.segmentation.load")
468+
@keras_cv_export(
469+
"keras_cv.datasets.pascal_voc.segmentation.load",
470+
package="keras_cv.datasets.pascal_voc_segmentation",
471+
)
469472
def load(
470473
split="sbd_train",
471474
data_dir=None,

keras_cv/keypoint/converters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def _xy_noop(keypoints, images=None):
6060
}
6161

6262

63-
@keras_cv_export("keras_cv.keypoint.convert_format")
63+
@keras_cv_export(
64+
"keras_cv.keypoint.convert_format", package="keras_cv.keypoint"
65+
)
6466
def convert_format(keypoints, source, target, images=None, dtype=None):
6567
"""Converts keypoints from one format to another.
6668

0 commit comments

Comments
 (0)