Commit 977896cb by Haichen Shen Committed by Tianqi Chen

[Bugfix] Fix type code error for StringImm (#3050)

parent f4fa0328
......@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
......@@ -251,6 +251,9 @@ class BuiltinLower : public IRMutator {
stack_value_, static_cast<int>(arg_stack_begin + i - 1),
intrinsic::kTVMValueContent, arg));
int arg_tcode = api_type.code();
if (api_type.is_handle() && arg.as<StringImm>()) {
arg_tcode = kStr;
}
if (IsArrayHandle(arg)) arg_tcode = kArrayHandle;
prep_seq_.emplace_back(
Store::make(stack_tcode_,
......
......@@ -29,7 +29,6 @@ def test_min_repeat_ms():
def my_debug(filename):
"""one call lasts for 100 ms and writes one character to a file"""
time.sleep(0.1)
filename = ctypes.c_char_p(filename.value).value
with open(filename, "a") as fout:
fout.write("c")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment