Skip to content

Error when compiling on clang C11 g++ #9

@methoxid

Description

@methoxid

pytorch-wordemb/src/loadwordemb.cpp:101:41: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'long long' in initializer list [-Wc++11-narrowing]
dest.resize_(torch::IntArrayRef{n_word, dim});

-Wc++11-narrowing
prevents compilation due to incompatible types Typedef Documentation using c10::IntArrayRef = ArrayRef<int64_t>
and
dest.resize_(torch::IntArrayRef{n_word, dim});

correct to:
dest.resize_(torch::IntArrayRef{(int64_t)n_word, (int64_t)dim});

or propose better / correct handling of types...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions