Skip to content

Alias KerasTensor as Tensor #21210

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
rivershah opened this issue Apr 25, 2025 · 0 comments
Open

Alias KerasTensor as Tensor #21210

rivershah opened this issue Apr 25, 2025 · 0 comments
Assignees
Labels
keras-team-review-pending Pending review by a Keras team member. type:feature The user is asking for a new feature.

Comments

@rivershah
Copy link

Can we please introduce an alias from KerasTensor to Tensor in keras by changing the import statement in the autogenerated stubs:

from keras.src.backend.common.keras_tensor import KerasTensor as KerasTensor

to:

from keras.src.backend.common.keras_tensor import KerasTensor as Tensor

This change aims to simplify the API, improve usability, and align naming convention across other critical building blocks such as keras.Model and keras.Layer

For example :
from keras import Model, Layer, Tensor, ops

This would be a trivial change downstream too but just think for the sake of alignment, we refactor in keras main repo

@dhantule dhantule added the type:feature The user is asking for a new feature. label Apr 25, 2025
@sonali-kumari1 sonali-kumari1 added the keras-team-review-pending Pending review by a Keras team member. label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keras-team-review-pending Pending review by a Keras team member. type:feature The user is asking for a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants