Skip to content

Commit b11026a

Browse files
committed
Minor refactoring
1 parent 75d34c9 commit b11026a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Bindings/Python/IRAttributes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,10 +1101,11 @@ class PyDenseElementsAttribute
11011101
template <typename Type>
11021102
py::buffer_info bufferInfo(MlirType shapedType,
11031103
const char *explicitFormat = nullptr) {
1104-
// Buffer is configured for read-only access below
1104+
intptr_t rank = mlirShapedTypeGetRank(shapedType);
1105+
// Prepare the data for the buffer_info.
1106+
// Buffer is configured for read-only access below.
11051107
Type *data = static_cast<Type *>(
11061108
const_cast<void *>(mlirDenseElementsAttrGetRawData(*this)));
1107-
intptr_t rank = mlirShapedTypeGetRank(shapedType);
11081109
// Prepare the shape for the buffer_info.
11091110
SmallVector<intptr_t, 4> shape;
11101111
for (intptr_t i = 0; i < rank; ++i)

0 commit comments

Comments
 (0)