Unverified Commit b01ddc95 authored by Julien Plu's avatar Julien Plu Committed by GitHub
Browse files

Remove value error (#8985)

* Remove value error

* Try a fix for parameter ordering

* Restore previous behavior

* Add documentation

* Review the comment
parent 91ab02af
...@@ -309,7 +309,9 @@ def booleans_processing(config, **kwargs): ...@@ -309,7 +309,9 @@ def booleans_processing(config, **kwargs):
def input_processing(func, config, input_ids, **kwargs): def input_processing(func, config, input_ids, **kwargs):
""" """
Process the input of each TensorFlow model including the booleans. Process the input of each TensorFlow model including the booleans. In case of a list of symbolic inputs, each input
has to be named accordingly to the parameters name, i.e. `input_ids = tf.keras.Input(shape=(128,), dtype='int32',
name="input_ids")` otherwise the order of the tensors will not be guaranteed during the training.
Args: Args:
func (:obj:`callable`): func (:obj:`callable`):
...@@ -365,9 +367,7 @@ def input_processing(func, config, input_ids, **kwargs): ...@@ -365,9 +367,7 @@ def input_processing(func, config, input_ids, **kwargs):
if tensor_name in parameter_names: if tensor_name in parameter_names:
output[tensor_name] = input output[tensor_name] = input
else: else:
raise ValueError( output[parameter_names[i]] = input
f"The tensor named {input.name} does not belong to the authorized list of names {parameter_names}."
)
elif isinstance(input, allowed_types) or input is None: elif isinstance(input, allowed_types) or input is None:
output[parameter_names[i]] = input output[parameter_names[i]] = input
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment