MCPcopy Index your code
hub / github.com/apache/tvm / upload

Method upload

python/tvm/rpc/client.py:97–119  ·  view source on GitHub ↗

Upload file to remote runtime temp folder Parameters ---------- data : str or bytearray The file name or binary in local to upload. target : str, optional The path in remote

(self, data, target=None)

Source from the content-addressed store, hash-verified

95 return dev
96
97 def upload(self, data, target=None):
98 """Upload file to remote runtime temp folder
99
100 Parameters
101 ----------
102 data : str or bytearray
103 The file name or binary in local to upload.
104
105 target : str, optional
106 The path in remote
107 """
108 if isinstance(data, bytearray):
109 if not target:
110 raise ValueError("target must present when file is a bytearray")
111 blob = data
112 else:
113 blob = bytearray(open(data, "rb").read())
114 if not target:
115 target = os.path.basename(data)
116
117 if "upload" not in self._remote_funcs:
118 self._remote_funcs["upload"] = self.get_function("tvm.rpc.server.upload")
119 self._remote_funcs["upload"](target, blob)
120
121 def download(self, path):
122 """Download file from remote temp folder.

Callers 15

default_upload_moduleFunction · 0.45
run_module_via_rpcFunction · 0.45
rpc_runFunction · 0.45
test_rpc_moduleFunction · 0.45
test_rpc_moduleFunction · 0.45
check_remoteFunction · 0.45
load_moduleMethod · 0.45
test_texture_copyFunction · 0.45
_runFunction · 0.45
verify_rpcFunction · 0.45
check_remoteFunction · 0.45
check_remote_link_clFunction · 0.45

Calls 2

get_functionMethod · 0.95
readMethod · 0.65

Tested by 9

test_rpc_moduleFunction · 0.36
test_rpc_moduleFunction · 0.36
check_remoteFunction · 0.36
test_texture_copyFunction · 0.36
verify_rpcFunction · 0.36
check_remoteFunction · 0.36
check_remote_link_clFunction · 0.36
build_armFunction · 0.36