mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/51124 Original commit changeset: 1c7133627da2 Test Plan: Test locally with interpreter_test and on CI Reviewed By: suo Differential Revision: D26077905 fbshipit-source-id: fae83bf9822d79e9a9b5641bc5191a7f3fdea78d
18 lines
540 B
Python
18 lines
540 B
Python
|
|
from .throughput_benchmark import ThroughputBenchmark
|
|
|
|
import os.path as _osp
|
|
import sys
|
|
|
|
# Set the module for a given object for nicer printing
|
|
def set_module(obj, mod):
|
|
if not isinstance(mod, str):
|
|
raise TypeError("The mod argument should be a string")
|
|
obj.__module__ = mod
|
|
|
|
if sys.executable == "torch_deploy":
|
|
# not valid inside torch_deploy interpreter, no paths exists for frozen modules
|
|
cmake_prefix_path = None
|
|
else:
|
|
cmake_prefix_path = _osp.join(_osp.dirname(_osp.dirname(__file__)), 'share', 'cmake')
|