Skip to content

Commit 772cd99

Browse files
author
ssjia
committed
Update on "[ET-VK][ez] Consolidate tensor metadata calculation + buffer binding code"
Differential Revision: [D80800085](https://our.internmc.facebook.com/intern/diff/D80800085) [ghstack-poisoned]
2 parents 5a87df1 + 6481495 commit 772cd99

File tree

1 file changed

+2
-1
lines changed
  • backends/vulkan/runtime/api/containers

1 file changed

+2
-1
lines changed

backends/vulkan/runtime/api/containers/Tensor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ std::vector<T> flip_and_unsqueeze(
675675
const size_t numel,
676676
const int32_t fixed_ndim = -1) {
677677
const size_t ndim = tensor_metadata.size();
678-
size_t ndim_up4 = utils::align_up_4(tensor_metadata.size());
678+
size_t ndim_up4 =
679+
std::max(utils::align_up_4(tensor_metadata.size()), size_t(4));
679680

680681
if (fixed_ndim > 0) {
681682
VK_CHECK_COND(fixed_ndim >= ndim);

0 commit comments

Comments
 (0)