Skip to content

Why FeatureExtractor implicitly add batch dimension for input other than torch.Tensor()? #69

@ganow

Description

@ganow

The current implementation of FeatureExtractor behaves as if it dynamically changes the shape of tensor at runtime depending on the type of data being input. This behavior seems intuitively quite non-trivial, but is there a clear reason why it was designed this way? It seems to me that the information about what type the input is and whether the input data has batch dimension should in principle be orthogonal concepts and should therefore be controlled separately by nature.

if not isinstance(x, torch.Tensor):
xt = torch.tensor(x[np.newaxis], device=self.__device)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions