Skip to content

Use numpy ndarray then convert to tensor instead of list of arrays #1

Description

@Saharsh1005
/Users/saharshbarve/Work/uiuc/study/Semester_3/cs511/project-bao/breakingBao/BaoForPostgreSQL/bao_server/model.py:55:
UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single
numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at
/Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/utils/tensor_new.cpp:281.)
  targets = torch.tensor(targets)

Can improve this for performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions