Skip to content

Remove stray uses of torch::executor:: from examples/... #5512

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

Closed
wants to merge 1 commit into from
Closed
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 examples/devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Once an `ETDump` has been generated, it can be viewed using the CLI inspector. T
ETDump profiling can also be used in a custom C++ program. `ETDumpGen` is an implementation of the abstract `EventTracer` class. Include the header file located at `devtools/etdump/etdump_flatcc.h`. To initialize the ETDump generator, construct it before loading the method from the program.

```cpp
torch::executor::ETDumpGen etdump_gen = torch::executor::ETDumpGen();
executorch::etdump::ETDumpGen etdump_gen;
Result<Method> method =
program->load_method(method_name, &memory_manager, &etdump_gen);
```
Expand Down
6 changes: 4 additions & 2 deletions examples/models/llava/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ DEFINE_int32(
-1,
"Number of CPU threads for inference. Defaults to -1, which implies we'll use a heuristic to derive the # of performant cores for a specific device.");

using executorch::extension::llm::Image;

int32_t main(int32_t argc, char** argv) {
gflags::ParseCommandLineFlags(&argc, &argv, true);

Expand Down Expand Up @@ -90,7 +92,7 @@ int32_t main(int32_t argc, char** argv) {
image_data.resize(3 * 240 * 336);
std::fill(image_data.begin(), image_data.end(), 0); // black
std::array<int32_t, 3> image_shape = {3, 240, 336};
std::vector<torch::executor::Image> images = {
std::vector<Image> images = {
{.data = image_data, .width = image_shape[2], .height = image_shape[1]}};
#else // LLAVA_NO_TORCH_DUMMY_IMAGE
// cv::Mat image = cv::imread(image_path, cv::IMREAD_COLOR);
Expand All @@ -111,7 +113,7 @@ int32_t main(int32_t argc, char** argv) {
image_data.assign(
image_tensor.data_ptr<uint8_t>(),
image_tensor.data_ptr<uint8_t>() + image_tensor.numel());
std::vector<torch::executor::Image> images = {
std::vector<Image> images = {
{.data = image_data,
.width = static_cast<int32_t>(image_tensor.size(2)),
.height = static_cast<int32_t>(image_tensor.size(1))}};
Expand Down
Loading