Since SIZE is a function of the class metatensor, this sentence does not work. The correct way should be "fg_indices.size()[0]". https://github.com/Project-MONAI/MONAI/blob/f407fcce1c32c050f327b26a16b7f7bc8a01f593/monai/transforms/utils.py#L512