MCPcopy Index your code
hub / github.com/NVIDIA/TensorRT-LLM / size

Method size

tensorrt_llm/functional.py:480–490  ·  view source on GitHub ↗

Returns the shape of the tensor if the dim parameter is None. Otherwise, returns a size of the dimension indicated by dim. The behavior is undefined if dim is negative or exceeds the rank of the tensor.

(self, dim=None)

Source from the content-addressed store, hash-verified

478 return cast(self, dtype)
479
480 def size(self, dim=None):
481 '''
482 Returns the shape of the tensor if the dim parameter is None.
483 Otherwise, returns a size of the dimension indicated by dim. The
484 behavior is undefined if dim is negative or exceeds the rank of the
485 tensor.
486 '''
487 if dim is None:
488 return self.trt_tensor.shape
489
490 return self.trt_tensor.shape[dim]
491
492 def rank(self):
493 '''

Callers 15

shapeMethod · 0.95
profile_allreduceFunction · 0.45
forwardMethod · 0.45
_construct_executionMethod · 0.45
_construct_executionMethod · 0.45
_attnMethod · 0.45
_split_headsMethod · 0.45
_merge_headsMethod · 0.45
test_gatherMethod · 0.45
per_token_cast_to_fp8Function · 0.45
per_block_cast_to_fp8Function · 0.45

Calls

no outgoing calls

Tested by 15

forwardMethod · 0.36
_construct_executionMethod · 0.36
_construct_executionMethod · 0.36
_attnMethod · 0.36
_split_headsMethod · 0.36
_merge_headsMethod · 0.36
test_gatherMethod · 0.36