Skip to content

FillEmptyRows-16 operator specification #28046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

p-wysocki
Copy link
Contributor

@p-wysocki p-wysocki commented Dec 12, 2024

Details:

Related PRs:

Tickets:

Signed-off-by: p-wysocki <[email protected]>
@github-actions github-actions bot added the category: docs OpenVINO documentation label Dec 12, 2024
Copy link
Contributor

This PR will be closed in a week because of 2 weeks of no activity.

@github-actions github-actions bot added the Stale label Feb 13, 2025
Copy link
Contributor

This PR was closed because it has been stalled for 2 week with no activity.

@github-actions github-actions bot closed this Feb 20, 2025
Signed-off-by: p-wysocki <[email protected]>
@p-wysocki p-wysocki reopened this Mar 25, 2025
@p-wysocki p-wysocki marked this pull request as ready for review March 25, 2025 16:21
@p-wysocki p-wysocki requested a review from a team as a code owner March 25, 2025 16:21
@p-wysocki p-wysocki requested review from tsavina and removed request for a team March 25, 2025 16:21
@github-actions github-actions bot removed the Stale label Mar 26, 2025
Comment on lines 46 to 52
* **1**: ``output_indices`` 2D tensor of type *T_IDX* indicating the positions at which ``output_values`` are placed in the sparse tensor.
It is of shape ``[M', N]``, where:

* ``M'`` is the length of the updated ``output_values``.
* ``N`` is equal to the rank of ``dense_shape``.
* **2**: ``output_values`` 1D tensor containing the values of type *T* to be inserted at the specified indices.
* **3**: ``empty_row_indicator`` 1D tensor of type ``boolean`` indicating True for rows which were empty before executing the operation.
Copy link
Contributor

Choose a reason for hiding this comment

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

To have the whole sparse tensor representation, shouldn't the dense_shape be an output as well?
On the other hand, assuming it's the same as the input dense_shape maybe it's reduntant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tf.raw_ops.SparseFillEmptyRows doesn't return the output SparseTensor at all according to https://www.tensorflow.org/api_docs/python/tf/raw_ops/SparseFillEmptyRows#returns. Do you think we should have it?

That's also interesting because there's tf.sparse.fill_empty_rows and then there's tf.raw_ops.SparseFillEmptyRows, which have quite different outputs:

https://www.tensorflow.org/api_docs/python/tf/sparse/fill_empty_rows
https://www.tensorflow.org/api_docs/python/tf/raw_ops/SparseFillEmptyRows

However the BST model I received is using the raw_ops one and in the graph the SparseTensor is not returned.

**Outputs**:

* **1**: ``output_indices`` 2D tensor of type *T_IDX* indicating the positions at which ``output_values`` are placed in the sparse tensor.
It is of shape ``[M', N]``, where:
Copy link
Member

Choose a reason for hiding this comment

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

do we really need generalization of tf.raw_ops.SparseFillEmptyRows? May be to consider only 2D sparse tensor that is only needed by TF?
I think ND case can be converged to 2D case by reshape

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If only 2D is needed, let's limit it. Applied.

Copy link
Member

@rkazants rkazants left a comment

Choose a reason for hiding this comment

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

btw, will we support the same operation for string sparse tensor?

p-wysocki and others added 3 commits April 11, 2025 12:41
…ts/operation-specs/sparse/fill-empty-rows-16.rst

Co-authored-by: Katarzyna Mitrus <[email protected]>
…ts/operation-specs/sparse/fill-empty-rows-16.rst

Co-authored-by: Roman Kazantsev <[email protected]>
…ts/operation-specs/sparse/fill-empty-rows-16.rst

Co-authored-by: Katarzyna Mitrus <[email protected]>
@p-wysocki
Copy link
Contributor Author

btw, will we support the same operation for string sparse tensor?

Yes, it's planned but as a separate operator. It was a decision based on how complex an all-in-one implementation would be - you can peek at the initial commit in the PR (7d810fc)

@p-wysocki p-wysocki requested review from mitruska and rkazants April 11, 2025 11:04
Signed-off-by: p-wysocki <[email protected]>
…ts/operation-specs/sparse/fill-empty-rows-16.rst
p-wysocki and others added 2 commits April 18, 2025 13:03
…ts/operation-specs/sparse/fill-empty-rows-16.rst

Co-authored-by: Roman Kazantsev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: docs OpenVINO documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants