Skip to content

Fix Detr batchsize 1 - Explicitly reshape target classes#552

Open
padentomasello wants to merge 2 commits into
flashlight:mainfrom
padentomasello:dev/paden/fix-detr-bs1
Open

Fix Detr batchsize 1 - Explicitly reshape target classes#552
padentomasello wants to merge 2 commits into
flashlight:mainfrom
padentomasello:dev/paden/fix-detr-bs1

Conversation

@padentomasello

Copy link
Copy Markdown
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
Copy Markdown

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

@facebook-github-bot

Copy link
Copy Markdown

@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.

2 participants