Skip to content

error with the Using the TorchScript Custom Operator in C++ example #910

Closed
@deepali-c

Description

@deepali-c

Observed the following error while executing the Using the TorchScript Custom Operator in C++ example:

	$ make -j
	Scanning dependencies of target example_app
	[ 50%] Building CXX object CMakeFiles/example_app.dir/main.cpp.o
	<mypath>/example_app/main.cpp: In function 'int main(int, const char**)':
	<mypath>/example_app/main.cpp:13:72: error: conversion from 'torch::jit::script::Module' to non-scalar type 'std::shared_ptr<torch::jit::script::Module>' requested
	   std::shared_ptr<torch::jit::script::Module> module = torch::jit::load(argv[1]);
	                                                        ~~~~~~~~~~~~~~~~^~~~~~~~~
	make[2]: *** [CMakeFiles/example_app.dir/main.cpp.o] Error 1
	make[1]: *** [CMakeFiles/example_app.dir/all] Error 2
make: *** [all] Error 2

I found that this is due to change in API - https://discuss.pytorch.org/t/shared-ptr-torch-module-module-torch-load/54950/2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions