forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reland "support running test_mobile_profiler with buck1/buck2 and OSS (…
…pytorch#89001)" (pytorch#89091) We modify this to no longer use std::experimental::filesystem::path and use our own custom type instead. This reverts commit c53a5ac. Pull Request resolved: pytorch#89091 Approved by: https://github.com/r-barnes, https://github.com/malfet
- Loading branch information
1 parent
e856a4d
commit f057a45
Showing
2 changed files
with
55 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace torch { | ||
namespace testing { | ||
|
||
namespace detail { | ||
class Path; | ||
} | ||
|
||
/// Gets the path to the resource identified by name. | ||
/// | ||
/// @param name identifies a resource, relative path starting from the | ||
/// repo root | ||
inline auto getResourcePath(std::string name) -> detail::Path; | ||
|
||
// End interface: implementation details follow. | ||
|
||
namespace detail { | ||
|
||
class Path { | ||
public: | ||
explicit Path(std::string rep) : rep_(std::move(rep)) {} | ||
|
||
auto string() const -> std::string const& { | ||
return rep_; | ||
} | ||
|
||
private: | ||
std::string rep_; | ||
}; | ||
|
||
} // namespace detail | ||
|
||
inline auto getResourcePath(std::string name) -> detail::Path { | ||
return detail::Path(std::move(name)); | ||
} | ||
|
||
} // namespace testing | ||
} // namespace torch |
This file contains 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