Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backends/vulkan/runtime/graph/ops/impl/UnaryOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ REGISTER_OPERATORS {
VK_REGISTER_OP(aten.log10.default, log10);
VK_REGISTER_OP(aten.round.default, round);
VK_REGISTER_OP(aten.bitwise_not.default, bitwise_not);
VK_REGISTER_OP(aten.logical_not.default, bitwise_not);
}

} // namespace vkcompute
12 changes: 12 additions & 0 deletions backends/vulkan/test/test_vulkan_delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,18 @@ def forward(self, x):

self.lower_unary_module_and_test_output(TanhModule())

def test_vulkan_backend_logical_not(self):
class LogicalNotModule(torch.nn.Module):
def __init__(self):
super().__init__()

def forward(self, x):
# logical_not produces a boolean tensor, which cannot be
# compared with torch.allclose, so select through it instead.
return torch.where(torch.logical_not(x > 0), x, torch.zeros_like(x))

self.lower_unary_module_and_test_output(LogicalNotModule())

def test_vulkan_backend_linear(self):
class LinearModule(torch.nn.Module):
def __init__(self):
Expand Down
Loading