ban __bool__ on Tensor (#3632)

* ban __bool__ on Tensor

avoid misuse

* test case

* fix tests

* fix more tests
This commit is contained in:
chenyu
2024-03-06 17:12:35 -05:00
committed by GitHub
parent 81baf3eed3
commit 8f10bfa2ff
7 changed files with 19 additions and 7 deletions

View File

@@ -35,7 +35,7 @@ class MBConvBlock:
def __call__(self, inputs):
x = inputs
if self._expand_conv:
if self._expand_conv is not None:
x = self._bn0(x.conv2d(self._expand_conv)).swish()
x = x.conv2d(self._depthwise_conv, padding=self.pad, stride=self.strides, groups=self._depthwise_conv.shape[0])
x = self._bn1(x).swish()