Skip to content

Commit 39a2834

Browse files
committed
Fix tensor
1 parent a3c9348 commit 39a2834

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/slangpy_ext/utils/slangpytensor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ NativeTensorMarshall::TensorFieldOffsets NativeTensorMarshall::extract_tensor_fi
162162
offsets.shape = tensor_cursor["_shape"].offset();
163163
offsets.strides = tensor_cursor["_strides"].offset();
164164
offsets.offset = tensor_cursor["_offset"].offset();
165-
offsets.element_byte_stride = tensor_cursor["_element_byte_stride"].offset();
165+
166+
ShaderCursor ebs_field = tensor_cursor.find_field("_element_byte_stride");
167+
if (ebs_field.is_valid())
168+
offsets.element_byte_stride = ebs_field.offset();
169+
166170
offsets.is_valid = true;
167171
offsets.array_stride
168172
= (int)tensor_cursor["_shape"].slang_type_layout()->getElementStride(SLANG_PARAMETER_CATEGORY_UNIFORM);

0 commit comments

Comments
 (0)