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

Fix Detr batchsize 1 - Explicitly reshape target classes #552

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

padentomasello
Copy link
Contributor

Some weird arrayfire behavior allows you to assign arrays of different dimensions but only if the dimensions are * not * singlular for the other dimensions.

For example, below, with batch_size 2, and num boxes 3, target_classes_full is { 100, 3 } and targetClassesi is { 1, 3 }. srcIdxs = { 3, 1 } . target_classes_full(srcIdxs, i) = targetClassesi is fine. (Arrayfire can assign to { 3, 1} from { 1, 3}.

For whatever reason, with batch_size 1, and num boxes 3, target_classes_full is now { 100, 1 } and like before targetClassesi is { 1, 3 }. srcIdxs = { 3, 1 } . target_classes_full(srcIdxs, i) = targetClassesi now fails. (Arrayfire cannot assign to { 3, 1} from { 1, 3 }.

Anyway, probably better to be explicit.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 20, 2021
@facebook-github-bot
Copy link

@padentomasello has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@padentomasello has updated the pull request. You must reimport the pull request before landing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants