Skip to content

fix!: Fixed Windows compilation failures #1330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/partitioning/shape_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void getSegmentsOutputByRunning(
}
if (cur_ivalue.toTensor().sizes().size() == 0) {
// handle Scalar types, which has sizes of []
input_shapes.push_back(util::toVec(util::toDims(c10::List<long int>({1}))));
input_shapes.push_back(util::toVec(util::toDims(c10::List<int64_t>({1}))));
} else {
input_shapes.push_back(util::toVec(util::toDims(cur_ivalue.toTensor().sizes())));
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/bin/torchtrtc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool unload_library(void* custom_lib) {
bool success = false;
#if defined(_WIN32)
// Returns status non-zero for success
success = FreeLibrary(custom_lib) ? true : false;
success = FreeLibrary((HMODULE)custom_lib) ? true : false;
#else
success = dlclose(custom_lib) ? false : true;
#endif
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/torch_tensorrt/torch_tensorrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class TensorFormat {
* signifying a static input shape or a set of three input shapes representing
* the min, optiminal and max input shapes allowed for the engine.
*/
struct TORCHTRT_API Input : torch::CustomClassHolder {
struct Input : torch::CustomClassHolder {
/// Minimum acceptable input size into the engine
std::vector<int64_t> min_shape;
/// Optimal input size into the engine (size optimized for given kernels accept any size in min max range)
Expand Down Expand Up @@ -520,7 +520,7 @@ struct TORCHTRT_API Input : torch::CustomClassHolder {
*
* This struct can either hold a complex inputs of shape or a flattened one,
*/
struct TORCHTRT_API GraphInputs {
struct GraphInputs {
torch::jit::IValue input_signature; // nested Input, full input spec
std::vector<Input> inputs; // flatten input spec
};
Expand Down Expand Up @@ -592,14 +592,14 @@ struct CompileSpec {
*
* @param inputs
*/
CompileSpec(std::vector<Input> inputs);
TORCHTRT_API CompileSpec(std::vector<Input> inputs);

/**
* @brief Construct a new Compile Spec object from IValue which represents the nesting of input tensors for a module.
*
* @param input_signature
*/
CompileSpec(torch::jit::IValue input_signature);
TORCHTRT_API CompileSpec(torch::jit::IValue input_signature);
// Defaults should reflect TensorRT defaults for BuilderConfig

/**
Expand Down