def forward_chainerx(self, inputs): x, = inputs return tuple(chainerx.split(x, self.indices_or_sections, self.axis))
def test_split_zero_sized_no_offset(device, shape, indices_or_sections, axis): # An (sub-)array of size 0 should always have 0 offset. a = chainerx.random.uniform(-1, 1, shape) assert a.offset == 0 # Test pre-condition. b = chainerx.split(a, indices_or_sections, axis) assert all(bi.offset == 0 for bi in b)