Skip to content

Commit a1a4786

Browse files
authored
Merge pull request #1330 from pytorch/anuragd/fix_windows_compilation
2 parents 2c55974 + 7245727 commit a1a4786

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

core/partitioning/shape_analysis.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void getSegmentsOutputByRunning(
167167
}
168168
if (cur_ivalue.toTensor().sizes().size() == 0) {
169169
// handle Scalar types, which has sizes of []
170-
input_shapes.push_back(util::toVec(util::toDims(c10::List<long int>({1}))));
170+
input_shapes.push_back(util::toVec(util::toDims(c10::List<int64_t>({1}))));
171171
} else {
172172
input_shapes.push_back(util::toVec(util::toDims(cur_ivalue.toTensor().sizes())));
173173
}

cpp/bin/torchtrtc/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bool unload_library(void* custom_lib) {
3535
bool success = false;
3636
#if defined(_WIN32)
3737
// Returns status non-zero for success
38-
success = FreeLibrary(custom_lib) ? true : false;
38+
success = FreeLibrary((HMODULE)custom_lib) ? true : false;
3939
#else
4040
success = dlclose(custom_lib) ? false : true;
4141
#endif

cpp/include/torch_tensorrt/torch_tensorrt.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class TensorFormat {
365365
* signifying a static input shape or a set of three input shapes representing
366366
* the min, optiminal and max input shapes allowed for the engine.
367367
*/
368-
struct TORCHTRT_API Input : torch::CustomClassHolder {
368+
struct Input : torch::CustomClassHolder {
369369
/// Minimum acceptable input size into the engine
370370
std::vector<int64_t> min_shape;
371371
/// Optimal input size into the engine (size optimized for given kernels accept any size in min max range)
@@ -520,7 +520,7 @@ struct TORCHTRT_API Input : torch::CustomClassHolder {
520520
*
521521
* This struct can either hold a complex inputs of shape or a flattened one,
522522
*/
523-
struct TORCHTRT_API GraphInputs {
523+
struct GraphInputs {
524524
torch::jit::IValue input_signature; // nested Input, full input spec
525525
std::vector<Input> inputs; // flatten input spec
526526
};
@@ -592,14 +592,14 @@ struct CompileSpec {
592592
*
593593
* @param inputs
594594
*/
595-
CompileSpec(std::vector<Input> inputs);
595+
TORCHTRT_API CompileSpec(std::vector<Input> inputs);
596596

597597
/**
598598
* @brief Construct a new Compile Spec object from IValue which represents the nesting of input tensors for a module.
599599
*
600600
* @param input_signature
601601
*/
602-
CompileSpec(torch::jit::IValue input_signature);
602+
TORCHTRT_API CompileSpec(torch::jit::IValue input_signature);
603603
// Defaults should reflect TensorRT defaults for BuilderConfig
604604

605605
/**

0 commit comments

Comments
 (0)