Skip to content

Conversation

jessechancy
Copy link
Contributor

No description provided.

Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg! one minor style point

if rank_1:
inputs = [tf.expand_dims(x, 0) for x in inputs]
inputs = [tf.RaggedTensor.from_tensor(x) for x in inputs]
inputs = self._convert_inputs(inputs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be slight easier/readable keep the loop outside.

inputs = [self._convert_dense(x) for x in input]

def _convert_dense(input):
    if isinstance(input, tf.Tensor):
        return tf.RaggedTensor.from_tensor(input)
    return input

Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mattdangerw mattdangerw merged commit cc0209a into keras-team:master Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants