count None using 'is'
@@ -28,7 +28,8 @@ class GetItem(function.Function):
def check_type_forward(self, in_types):
type_check.expect(in_types.size() == 1)
- valid_slice = len(self.slices) - self.slices.count(None)
+ n_nones = len([item for item in self.slices if item is None])
+ valid_slice = len(self.slices) - n_nones
type_check.expect(in_types[0].ndim >= valid_slice)
def forward(self, xs):
