diff --git a/core/lowering/register_trt_placeholder_ops.cpp b/core/lowering/register_trt_placeholder_ops.cpp index d083c71715..ccdeea0763 100644 --- a/core/lowering/register_trt_placeholder_ops.cpp +++ b/core/lowering/register_trt_placeholder_ops.cpp @@ -20,7 +20,6 @@ RegisterOperators trt_placeholder_ops_reg({ [](Stack& stack) { auto attn_mask = pop(stack).to(); if (attn_mask.scalar_type() == at::kBool) { - attn_mask = attn_mask; attn_mask.masked_fill_(attn_mask.logical_not(), -std::numeric_limits::infinity()); } return attn_mask; diff --git a/cpp/src/types.cpp b/cpp/src/types.cpp index 69b956a162..8b7569636c 100644 --- a/cpp/src/types.cpp +++ b/cpp/src/types.cpp @@ -158,6 +158,7 @@ TensorFormat::TensorFormat(at::MemoryFormat t) { switch (t) { case at::MemoryFormat::ChannelsLast: value = TensorFormat::kChannelsLast; + break; case at::MemoryFormat::Contiguous: default: value = TensorFormat::kContiguous;