Skip to content

Commit aa8ffc1

Browse files
committed
repalce toDimsPadAtEnd with toDimsTailPad
Signed-off-by: Ruoqian Guo <[email protected]>
1 parent 0e8e148 commit aa8ffc1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

core/conversion/converters/impl/batch_norm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ auto batch_norm_registrations TRTORCH_UNUSED = RegisterNodeConversionPatterns().
4343
auto should_unpack = util::toVec(orig_shape).size() < 4;
4444
if (should_unpack) {
4545
// expand spatial dims from 1D to 2D
46-
auto new_shape = util::toDimsPadAtEnd(util::toVec(orig_shape), 4);
46+
auto new_shape = util::toDimsTailPad(util::toVec(orig_shape), 4);
4747
LOG_DEBUG(
4848
"Input shape is less than 4D got: "
4949
<< orig_shape << ", inserting shuffle layer to reshape to 4D tensor shape: " << new_shape);

core/util/trt_util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ nvinfer1::Dims toDimsPad(c10::IntArrayRef l, uint64_t pad_to) {
8686
return dims;
8787
}
8888

89-
nvinfer1::Dims toDimsPadAtEnd(c10::IntArrayRef l, uint64_t pad_to) {
89+
nvinfer1::Dims toDimsTailPad(c10::IntArrayRef l, uint64_t pad_to) {
9090
if (l.size() > pad_to) {
9191
LOG_DEBUG(
9292
"Requested padding of dimensions to " << pad_to << " but found " << l.size()
@@ -160,7 +160,7 @@ nvinfer1::Dims toDimsPad(c10::List<int64_t> l, uint64_t pad_to) {
160160
return dims;
161161
}
162162

163-
nvinfer1::Dims toDimsPadAtEnd(c10::List<int64_t> l, uint64_t pad_to) {
163+
nvinfer1::Dims toDimsTailPad(c10::List<int64_t> l, uint64_t pad_to) {
164164
if (l.size() > pad_to) {
165165
LOG_DEBUG(
166166
"Requested padding of dimensions to " << pad_to << " but found " << l.size()

core/util/trt_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ int64_t volume(const nvinfer1::Dims& d);
9292
bool broadcastable(nvinfer1::Dims a, nvinfer1::Dims b, bool multidirectional = true);
9393
nvinfer1::Dims toDimsPad(c10::IntArrayRef l, uint64_t pad_to);
9494
nvinfer1::Dims toDimsPad(c10::List<int64_t> l, uint64_t pad_to);
95-
nvinfer1::Dims toDimsPadAtEnd(c10::IntArrayRef l, uint64_t pad_to);
96-
nvinfer1::Dims toDimsPadAtEnd(c10::List<int64_t> l, uint64_t pad_to);
95+
nvinfer1::Dims toDimsTailPad(c10::IntArrayRef l, uint64_t pad_to);
96+
nvinfer1::Dims toDimsTailPad(c10::List<int64_t> l, uint64_t pad_to);
9797
nvinfer1::Dims unpadDims(const nvinfer1::Dims& d);
9898
nvinfer1::Dims unsqueezeDims(const nvinfer1::Dims& d, int pos);
9999
nvinfer1::Dims squeezeDims(const nvinfer1::Dims& d, int pos);

0 commit comments

Comments
 (0)