Skip to content

Commit a2b43b9

Browse files
committed
Update
1 parent 6dace6a commit a2b43b9

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

python/common.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ def __init__(self,
7474
(size, ))
7575
self._device = cuda_call(cudart.cudaMalloc(nbytes))
7676
self._nbytes = nbytes
77-
self.name = name
78-
self.shape = shape
79-
self.format = format
80-
self.dtype = dtype
77+
self._name = name
78+
self._shape = shape
79+
self._format = format
80+
self._dtype = dtype
8181

8282
@property
8383
def host(self) -> np.ndarray:
@@ -99,6 +99,22 @@ def device(self) -> int:
9999
def nbytes(self) -> int:
100100
return self._nbytes
101101

102+
@property
103+
def name(self) -> Optional[str]:
104+
return self._name
105+
106+
@property
107+
def shape(self) -> Optional[trt.Dims]:
108+
return self._shape
109+
110+
@property
111+
def format(self) -> Optional[trt.TensorFormat]:
112+
return self._format
113+
114+
@property
115+
def dtype(self) -> np.dtype:
116+
return self._dtype
117+
102118
def __str__(self):
103119
return f"Host:\n{self.host}\nDevice:\n{self.device}\nSize:\n{self.nbytes}\n"
104120

0 commit comments

Comments
 (0)