MCPcopy Create free account
hub / github.com/CSAILVision/gandissect / tensor_to_numpy_image_batch

Function tensor_to_numpy_image_batch

netdissect/aceoptimize.py:762–765  ·  view source on GitHub ↗
(tensor_image)

Source from the content-addressed store, hash-verified

760
761
762def tensor_to_numpy_image_batch(tensor_image):
763 byte_image = (((tensor_image+1)/2)*255).clamp(0, 255).byte()
764 numpy_image = byte_image.permute(0, 2, 3, 1).cpu().numpy()
765 return numpy_image
766
767# Phase 4: evaluation of intervention
768

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected