(ndataset, idx)
return non_idx
input:
    int32
    batch_size * npoint                int32
returns:
    batch_size * (ndataset-npoint)     int32
input:
    int32
    batch_size * npoint                int32
returns:
    batch_size * (ndataset-npoint)     int32
input : int32 batch_size * npoint int32 returns : batch_size * ( ndataset - npoint ) int32
def non_sampled(ndataset, idx):
    """
input:
    int32
    batch_size * npoint                int32
returns:
    batch_size * (ndataset-npoint)     int32
    """

    idx_shape = idx.get_shape().as_list()
    batch_size = idx_shape[
        0
    ]  # use static shape instead of dynamic shape (tf.shape(idx)[0])
    npoint = idx_shape[
        1
    ]  # # use static shape instead of dynamic shape (tf.shape(idx)[1])

    x = tf.range(npoint)  # [0, 1, ..., npoint-1]
    y = tf.range(batch_size)  # [0, 1, ..., batch_size-1]
    _, iy = tf.meshgrid(x, y)

    sampled_indices = tf.stack([iy, idx], 2)

    ones = tf.ones([batch_size, npoint], tf.int32)
    sampled_indicator = tf.scatter_nd(sampled_indices, ones, [batch_size, ndataset])

    zero = tf.constant(0, dtype=tf.int32)
    non_sampled_ij = tf.where(tf.equal(sampled_indicator, zero))

    non_idx = tf.reshape(non_sampled_ij[:, 1], [batch_size, ndataset - npoint])
    non_idx = tf.cast(non_idx, tf.int32)
    return non_idx
def non_sampled ( ndataset , idx ) : idx_shape = idx . get_shape ( ) . as_list ( ) batch_size = idx_shape [ 0 ] # use static shape instead of dynamic shape (tf.shape(idx)[0]) npoint = idx_shape [ 1 ] # # use static shape instead of dynamic shape (tf.shape(idx)[1]) x = tf . range ( npoint ) # [0, 1, ..., npoint-1] y = tf . range ( batch_size ) # [0, 1, ..., batch_size-1] _ , iy = tf . meshgrid ( x , y ) sampled_indices = tf . stack ( [ iy , idx ] , 2 ) ones = tf . ones ( [ batch_size , npoint ] , tf . int32 ) sampled_indicator = tf . scatter_nd ( sampled_indices , ones , [ batch_size , ndataset ] ) zero = tf . constant ( 0 , dtype = tf . int32 ) non_sampled_ij = tf . where ( tf . equal ( sampled_indicator , zero ) ) non_idx = tf . reshape ( non_sampled_ij [ : , 1 ] , [ batch_size , ndataset - npoint ] ) non_idx = tf . cast ( non_idx , tf . int32 ) return non_idx