MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / dim_resolve_negative

Function dim_resolve_negative

tensorrt_llm/_utils.py:468–476  ·  view source on GitHub ↗
(dim, ndim)

Source from the content-addressed store, hash-verified

466
467
468def dim_resolve_negative(dim, ndim):
469 if not isinstance(dim, tuple):
470 dim = (dim, )
471 pos = []
472 for d in dim:
473 if d < 0:
474 d = ndim + d
475 pos.append(d)
476 return tuple(pos)
477
478
479def get_free_port() -> int:

Callers 7

permuteFunction · 0.85
squeezeFunction · 0.85
cumsumFunction · 0.85
concatFunction · 0.85
reduceFunction · 0.85
argmaxFunction · 0.85
topkFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected