fix: include str ivalue type conversion#1785
Merged
Conversation
gs-olive
reviewed
Mar 30, 2023
Contributor
There was a problem hiding this comment.
Looks good to me, just made a style recommendation, and I've verified that this resolves the error being displayed in #1756. I do see another error now when running that model, however, also during partitioning:
/usr/local/lib/python3.8/dist-packages/torch/jit/_recursive.py:266: UserWarning: 'batch_first' was found in ScriptModule constants, but was not actually set in __init__. Consider removing it.
warnings.warn("'{}' was found in ScriptModule constants, "
Traceback (most recent call last):
File "issue_1756.py", line 56, in <module>
trt_ts_module = torch_tensorrt.compile(
File "~/TensorRT/py/torch_tensorrt/_compile.py", line 125, in compile
return torch_tensorrt.ts.compile(
File "~/TensorRT/py/torch_tensorrt/ts/_compiler.py", line 136, in compile
compiled_cpp_mod = _C.compile_graph(module._c, _parse_compile_spec(spec))
RuntimeError: Expected Tensor but got Uninitialized
gs-olive
reviewed
Mar 30, 2023
core/partitioning/shape_analysis.cpp
Outdated
| jit_inputs_ivalues.push_back(ivalues_maps[input].toGenericDict()); | ||
| } else if (input->type()->kind() == torch::jit::TypeKind::DeviceObjType) { | ||
| jit_inputs_ivalues.push_back(ivalues_maps[input].toDevice()); | ||
| } else if (input->type() == (torch::jit::StringType::get())) { |
Contributor
There was a problem hiding this comment.
Consider switching to input->type()->isSubtypeOf(torch::jit::StringType::get()), for consistency with the above operators (lines 188 - 197)
Collaborator
Author
Yes, I also noticed this one, Iet me cc you for that discussion |
0772af8 to
d728dff
Compare
d728dff to
3be288f
Compare
3be288f to
37b5d5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1756
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: