Skip to content
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

#7783: Port ttnn.upsample to C++ #8237

Merged
merged 1 commit into from
May 24, 2024
Merged

#7783: Port ttnn.upsample to C++ #8237

merged 1 commit into from
May 24, 2024

Conversation

xanderchin
Copy link
Contributor

No description provided.

inline ttnn::Tensor upsample(
const ttnn::Tensor& input_tensor,
//std::variant<float, std::tuple<float, float>, std::tuple<float, float, float>, std::tuple<float, float, float, float>> scale_factor,
std::variant<int, std::vector<int>> scale_factor,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not change this to use std::variant<std::array<float, 2>, std::array<float, 3>, std::array<float, 4>> and std::visit the helper implementation

Copy link
Collaborator

Choose a reason for hiding this comment

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

then you avoid the runtime overhead of the vector size checks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed this comment earlier. Makes sense.. I'm gonna update.

TT_THROW("Unsupported scale factor");
}
}
// DEBUG
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete

@xanderchin xanderchin force-pushed the xan/issue-7783-upsample branch from d786bfc to 1f623e8 Compare May 17, 2024 15:50
@xanderchin xanderchin force-pushed the xan/issue-7783-upsample branch 2 times, most recently from 3348ba6 to 4c189f7 Compare May 23, 2024 23:33
@xanderchin xanderchin force-pushed the xan/issue-7783-upsample branch from 4c189f7 to 36c8585 Compare May 24, 2024 00:11
@xanderchin xanderchin merged commit 4d6e8c0 into main May 24, 2024
5 checks passed
@xanderchin xanderchin deleted the xan/issue-7783-upsample branch May 24, 2024 00:12
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