tf.boolean_mask( tensor, mask, axis=None, name='boolean_mask')Numpy等价是张量[掩模]。...# 1-D exampletensor = [0, 1, 2, 3]mask = np.array([True, False, True, False])boolean_mask(tensor, mask...参数:tensor:一天张量。mask:K- d布尔张量,K <= N, K必须静态已知。axis:一个0-D int张量,表示要掩模的张量中的轴。默认情况下,axis为0,它将屏蔽第一个维度。...conform.例:# 2-D exampletensor = [[1, 2], [3, 4], [5, 6]]mask = np.array([True, False, True])boolean_mask(tensor