MCPcopy Create free account
hub / github.com/pytorch/pytorch / FetchInt8BlobRealVal

Function FetchInt8BlobRealVal

caffe2/python/workspace.py:424–438  ·  view source on GitHub ↗

Fetches an Int8 blob from the workspace and return its real value representation. Inputs: name: the name of the Int8 blob - a string or a BlobReference Returns: real value representation of int8 numpy array

(name)

Source from the content-addressed store, hash-verified

422
423
424def FetchInt8BlobRealVal(name):
425 """Fetches an Int8 blob from the workspace and return its real value representation.
426
427 Inputs:
428 name: the name of the Int8 blob - a string or a BlobReference
429 Returns:
430 real value representation of int8 numpy array
431 """
432 result = C.fetch_blob(StringifyBlobName(name))
433 assert isinstance(result, tuple), \
434 'You are not fetching an Int8Blob {}. Please use FetchBlob'.format(
435 StringifyBlobName(name))
436 int8_blob = Int8Tensor(*result)
437 return (int8_blob.data.astype(np.int32) - int(int8_blob.zero_point)).astype(
438 np.float32) * int8_blob.scale
439
440
441def RemoveBlob(name) -> None:

Callers

nothing calls this directly

Calls 4

StringifyBlobNameFunction · 0.85
isinstanceFunction · 0.85
astypeMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…