    def _infer_shapes(self, x: Tensor):
        """infer output shape"""
        x_shape_values = [var._attrs["values"] for var in x._attrs["shape"]]
        x_shapes = itertools.product(*x_shape_values)
        # run infershape for each
        y_shapes = []
        for x_shape in x_shapes:
            y_shape = self._infer_shape(x_shape)
            y_shapes.append(y_shape)

        def unique(vector):
            return sorted(set(vector))

        output_shape = []
        for idx in range(len(y_shapes[0])):
            output_shape.append(
                shape_utils.gen_int_var(values=unique([d[idx] for d in y_shapes]))
            )
        return output_shape
infer output shape
python/aitemplate/compiler/ops/vision_ops/nms/batched_nms.py