MCPcopy
hub / github.com/fauxpilot/fauxpilot / pb2torch

Function pb2torch

python_backend/model.py:13–16  ·  view source on GitHub ↗
(request, name)

Source from the content-addressed store, hash-verified

11
12
13def pb2torch(request, name):
14 tensor = pb_utils.get_input_tensor_by_name(request, name)
15 return torch.from_numpy(tensor.as_numpy())
16 # return from_dlpack(tensor.to_dlpack())
17
18
19def torch2pb(name, tensor):

Callers 1

executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected