Skip to content

How is the GPU vs CPU tensor management done? #758

@afonso-sousa

Description

@afonso-sousa

Hi. I have trouble understanding how and when do you send tensors to the GPU. I have a custom training routine where I use your dataloader and some modules using the build_X methods. When the data comes from your dataloaders, neither the data nor the model is required to be in the GPU. The tensors must be in the CPU for the modules to handle, which otherwise will raise an error of mismatched memory allocation for input and model. For example, for an Anchor3dHead, the passed tensor is sent through a Conv2d layer (

cls_score = self.conv_cls(x)
), and I cannot find anywhere along the way any .to(device) or .cuda(). Yet, the processing seems really fast. Can you give me some insights on how is this done?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions