Small refactor to improve the readability of the Model class for those who use the code as documentation.
General idea: most important methods come first, private utilities are moved to the bottom of the class. Also use a single method for `_standardize_user_data` (previously split into 2 methods that did not reflect two separate sets of actions). PiperOrigin-RevId: 225094903
This commit is contained in:
parent
a54fd6b713
commit
e8c65fa77f
File diff suppressed because it is too large
Load Diff
@ -570,11 +570,8 @@ def _get_input_from_iterator(iterator, model):
|
||||
# Validate that all the elements in x and y are of the same type and shape.
|
||||
# We can then pass the first element of x and y to `_standardize_weights`
|
||||
# below and be confident of the output.
|
||||
x_values, y_values, sample_weights_values = distributed_training_utils.\
|
||||
validate_distributed_dataset_inputs(model._distribution_strategy, x, y,
|
||||
sample_weights)
|
||||
model._standardize_weights(x_values, y_values,
|
||||
sample_weight=sample_weights_values)
|
||||
distributed_training_utils.validate_distributed_dataset_inputs(
|
||||
model._distribution_strategy, x, y, sample_weights)
|
||||
return x, y, sample_weights
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user