MCPcopy Create free account
hub / github.com/OpenDCAI/DataFlow-MM / normalize_matrix

Function normalize_matrix

dataflow/utils/utils.py:78–81  ·  view source on GitHub ↗
(A)

Source from the content-addressed store, hash-verified

76
77
78def normalize_matrix(A):
79 assert len(A.shape) == 2
80 A_norm = torch.linalg.norm(A, dim=-1, keepdim=True)
81 return A / A_norm
82
83
84def encode_video(video_file, preprocess, model, batch_size, device):

Callers 2

encode_videoFunction · 0.85
em_cos_scoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected