Skip to content

Commit c484af7

Browse files
committed
Combine .so files into one place to reduce whl package size
Signed-off-by: Yong Tang <[email protected]>
1 parent 783bbd5 commit c484af7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

tensorflow_io/arrow/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ load(
77
"tf_io_copts",
88
)
99

10-
cc_binary(
11-
name = "python/ops/_arrow_ops.so",
10+
cc_library(
11+
name = "arrow_ops",
1212
srcs = [
1313
"kernels/arrow_dataset_ops.cc",
1414
"kernels/arrow_kernels.cc",
@@ -20,7 +20,7 @@ cc_binary(
2020
"ops/dataset_ops.cc",
2121
],
2222
copts = tf_io_copts(),
23-
linkshared = 1,
23+
linkstatic = True,
2424
deps = [
2525
"//tensorflow_io/core:dataset_ops",
2626
"@arrow",

tensorflow_io/arrow/python/ops/arrow_dataset_ops.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
from tensorflow.compat.v2 import data
3131
from tensorflow.python.data.ops.dataset_ops import flat_structure
3232
from tensorflow.python.data.util import structure as structure_lib
33-
from tensorflow_io import _load_library
34-
arrow_ops = _load_library('_arrow_ops.so')
33+
from tensorflow_io.core.python.ops import core_ops
3534

3635
if hasattr(tf, "nest"):
3736
from tensorflow import nest # pylint: disable=ungrouped-imports
@@ -183,7 +182,7 @@ def __init__(self,
183182
"auto" (size to number of records in Arrow record batch)
184183
"""
185184
super(ArrowDataset, self).__init__(
186-
partial(arrow_ops.arrow_dataset, serialized_batches),
185+
partial(core_ops.arrow_dataset, serialized_batches),
187186
columns,
188187
output_types,
189188
output_shapes,
@@ -316,7 +315,7 @@ def __init__(self,
316315
dtype=dtypes.string,
317316
name="filenames")
318317
super(ArrowFeatherDataset, self).__init__(
319-
partial(arrow_ops.arrow_feather_dataset, filenames),
318+
partial(core_ops.arrow_feather_dataset, filenames),
320319
columns,
321320
output_types,
322321
output_shapes,
@@ -401,7 +400,7 @@ def __init__(self,
401400
dtype=dtypes.string,
402401
name="endpoints")
403402
super(ArrowStreamDataset, self).__init__(
404-
partial(arrow_ops.arrow_stream_dataset, endpoints),
403+
partial(core_ops.arrow_stream_dataset, endpoints),
405404
columns,
406405
output_types,
407406
output_shapes,
@@ -600,7 +599,7 @@ def list_feather_columns(filename, **kwargs):
600599
if not tf.executing_eagerly():
601600
raise NotImplementedError("list_feather_columns only support eager mode")
602601
memory = kwargs.get("memory", "")
603-
columns, dtypes_, shapes = arrow_ops.list_feather_columns(
602+
columns, dtypes_, shapes = core_ops.list_feather_columns(
604603
filename, memory=memory)
605604
entries = zip(tf.unstack(columns), tf.unstack(dtypes_), tf.unstack(shapes))
606605
return dict([(column.numpy().decode(), tf.TensorSpec(

tensorflow_io/core/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ cc_binary(
125125
linkshared = 1,
126126
deps = [
127127
":core_ops",
128+
"//tensorflow_io/arrow:arrow_ops",
128129
"//tensorflow_io/audio:audio_ops",
129130
"//tensorflow_io/avro:avro_ops",
130131
"//tensorflow_io/azure:azfs_ops",

0 commit comments

Comments
 (0)