例如下面的代码,输出的cond的的可变的[2, ?]这种情况怎么处理?
def my_where(x): cond = np.where(np.greater_equal(x, 0)) return cond cond = create_tmp_var(name='cond', dtype=label_int.dtype, shape=label_int.shape) cond = fluid.layers.py_func(func=my_where, x=label_int, out=cond) picked = fluid.layers.squeeze(cond, axes=[])
def my_where(x): cond = np.where(np.greater_equal(x, 0)) return cond cond = create_tmp_var(name='cond', dtype=label_int.dtype, shape=label_int.shape) cond = fluid.layers.py_func(func=my_where, x=label_int, out=cond) picked = fluid.layers.squeeze(cond, axes=[])