Skip to content

Commit e668147

Browse files
author
Valery Chernov
committed
fix lint
1 parent 18b68a2 commit e668147

File tree

2 files changed

+13
-9
lines changed
  • include/tvm/runtime/vm
  • src/runtime/vm

2 files changed

+13
-9
lines changed

include/tvm/runtime/vm/vm.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ struct VMFunction {
9494
instructions(std::move(instructions)),
9595
register_file_size(register_file_size),
9696
param_device_indexes(std::move(param_device_indexes)) {
97-
ICHECK_EQ(params.size(), param_device_indexes.size())
98-
<< "The number of provided parameters doesn't match the number of assigned devices";
99-
}
97+
ICHECK_EQ(params.size(), param_device_indexes.size())
98+
<< "The number of provided parameters doesn't match the number of assigned devices";
99+
}
100100

101101
VMFunction() = default;
102102

@@ -280,7 +280,7 @@ class VirtualMachine : public runtime::ModuleNode {
280280
* function. If the tensor is not of the correct device for the function,
281281
* they will be copied to the device.
282282
*/
283-
void SetOneInputTensor(std::string func_name, TVMArgs args);
283+
void SetOneInputTensor(std::string name, TVMArgs args);
284284

285285
/*!
286286
* \brief Internal hook for profiling the start of an op.
@@ -305,15 +305,17 @@ class VirtualMachine : public runtime::ModuleNode {
305305
* \param input_name The input tensor name.
306306
* \return The input tensor index.
307307
*/
308-
int64_t getInputIndexFromVMFunction(const std::string& func_name, const std::string& input_name) const;
308+
int64_t getInputIndexFromVMFunction(const std::string& func_name,
309+
const std::string& input_name) const;
309310

310311
/*!
311312
* \brief Get index of input tensor from its name.
312313
* \param params parameter names.
313314
* \param input_name The input tensor name.
314315
* \return The input tensor index.
315316
*/
316-
int64_t getInputIndexFromName(const std::vector<std::string>& params, const std::string& input_name) const;
317+
int64_t getInputIndexFromName(const std::vector<std::string>& params,
318+
const std::string& input_name) const;
317319

318320
/*!
319321
* \brief Check executable exists and get VM function from it.

src/runtime/vm/vm.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,19 @@ void VirtualMachine::SetInput(std::string func_name, TVMArgs args, int offset) {
242242
}
243243

244244
void VirtualMachine::SetOneInputTensor(std::string func_name, TVMArgs args) {
245-
ICHECK_EQ(args.size(), 3) << "The expected number of arguments is 3 (func_name, index or name, tensor)";
245+
ICHECK_EQ(args.size(), 3) << "The expected number of arguments is 3 "
246+
<< "(func_name, index or name, tensor)";
246247
const auto& vm_func = checkAndGetVMFunction(func_name);
247248
size_t params_num = vm_func.params.size();
248249

249250
int inp_index;
250251
if (args[1].type_code() == kTVMArgInt) {
251252
inp_index = args[1];
252253
} else if (args[1].type_code() == kTVMStr) {
253-
inp_index = int(getInputIndexFromName(vm_func.params, args[1]));
254+
inp_index = static_cast<int>(getInputIndexFromName(vm_func.params, args[1]));
254255
} else {
255-
LOG(FATAL) << "The second argument type (" << args[1].type_code() << ") doesn't match integer or string";
256+
LOG(FATAL) << "The second argument type (" << args[1].type_code()
257+
<< ") doesn't match integer or string";
256258
}
257259
ICHECK_LT(inp_index, params_num);
258260

0 commit comments

Comments
 (0)