Change Clay forward signature to work with tasks #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All tasks assume the batch returned by the dataloader is a dictionary with an
"image"
key, the corresponding y label (either"mask"
or"label"
) and the rest of elements of the dictionary are passed as keyword arguments to the model, see an example here.For this reason, it was not possible to pass the metadata to Clay using a dictionary (which is what Clay expected).
This PR modifies Clay to accept the metadata as keyword arguments instead of a dict and the
Embedder
constructs the dictionary using aDatacuber
.It also fixes a computation of the positional embedding when a device different than
cpu
is used.