[JIT] Fix clang-tidy warnings for jit/frontend (#47982)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47982

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Differential Revision: D25258640

Pulled By: SplitInfinity

fbshipit-source-id: e2cf27130311904aa5b18e3232349604d01701a0
This commit is contained in:
Meghan Lele
2020-12-02 12:28:09 -08:00
committed by Facebook GitHub Bot
parent 4aa5d68874
commit 3039d24f4a
14 changed files with 55 additions and 60 deletions

View File

@ -202,14 +202,14 @@ struct SchemaParser {
IValue convertToList(
TypeKind kind,
const SourceRange& range,
std::vector<IValue> vs) {
const std::vector<IValue>& vs) {
switch (kind) {
case TypeKind::FloatType:
return fmap(vs, [](IValue v) { return v.toDouble(); });
return fmap(vs, [](const IValue& v) { return v.toDouble(); });
case TypeKind::IntType:
return fmap(vs, [](IValue v) { return v.toInt(); });
return fmap(vs, [](const IValue& v) { return v.toInt(); });
case TypeKind::BoolType:
return fmap(vs, [](IValue v) { return v.toBool(); });
return fmap(vs, [](const IValue& v) { return v.toBool(); });
default:
throw ErrorReport(range)
<< "lists are only supported for float or int types";
@ -224,7 +224,7 @@ struct SchemaParser {
} while (L.nextIf(','));
}
L.expect(']');
return convertToList(kind, tok.range, std::move(vs));
return convertToList(kind, tok.range, vs);
}
IValue parseTensorDefault(const SourceRange& range) {