Skip to content

Assign torch.cuda.FloatTensor to List tensor #25518

@IAMAl

Description

@IAMAl

❓ Questions and Help

I make custom cell and use eager execution on CUDA.
Then I meet segmentation fault to assign torach.cuda.FloatTensor to List tensor.

List Tensor is defined in init(self) as;

self.x     = [torch.zeros(NUM_INPUT, device='cuda') for _ in range(NUM_HIDDEN)]

And the self.x is done as;

for x, t in dataloader_train:
  for time in range(TIME_STEPS):
     for index in range(NUM_HIDDEN-1, 0, -1):
       model.x[index] = model.x[index - 1]
  
     model.x[0] = torch.cuda.FloatTensor(x[0][0][time])

Then output is

Segmentation fault

How to avoid from the fault?

Metadata

Metadata

Assignees

No one assigned

    Labels

    has workaroundmodule: crashProblem manifests as a hard crash, as opposed to a RuntimeErrormodule: cudaRelated to torch.cuda, and CUDA support in generaltriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions