Skip to content

Commit

Permalink
Export the pack/unpack sample weight utils (keras-team#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdangerw authored Jun 1, 2023
1 parent 764b285 commit f5df415
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions keras_core/trainers/data_adapters/data_adapter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import numpy as np
import tensorflow as tf

from keras_core.api_export import keras_core_export

try:
import pandas
except ImportError:
Expand All @@ -21,6 +23,7 @@
# TODO: support torch tensors?


@keras_core_export("keras_core.utils.unpack_x_y_sample_weight")
def unpack_x_y_sample_weight(data):
"""Unpacks user-provided data tuple.
Expand Down Expand Up @@ -63,6 +66,7 @@ def unpack_x_y_sample_weight(data):
raise ValueError(error_msg)


@keras_core_export("keras_core.utils.pack_x_y_sample_weight")
def pack_x_y_sample_weight(x, y=None, sample_weight=None):
"""Packs user-provided data into a tuple.
Expand Down

0 comments on commit f5df415

Please sign in to comment.