def _prepare(self, inputs):
    '\n        Prepare inputs, outputs, attrs.\n        '
    assert isinstance(inputs, (tuple, list))
    flatten_inputs = flatten(inputs)
    input_vars = []
    for (i, value) in enumerate(flatten_inputs):
        if isinstance(value, np.ndarray):
            var = core.VarBase(value=value, name=self._inputs[i].desc.name(), persistable=False, place=framework._current_expected_place(), zero_copy=True)
        elif isinstance(value, core.VarBase):
            value.name = self._inputs[i].desc.name()
            if value.stop_gradient:
                var = paddle.to_tensor(value, dtype=value.dtype, place=framework._current_expected_place(), stop_gradient=True)
                var.name = value.name
            else:
                var = value
        else:
            continue
        input_vars.append(var)
    out_vars = []
    for idx in self._outputs.var_ids:
        var = self._outputs[idx]
        assert isinstance(var, framework.Variable)
        var_desc = var.desc
        var_base = core.VarBase(var_desc.dtype(), var_desc.shape(), var_desc.name(), var_desc.type(), False)
        out_vars.append(var_base)
    tmp_scope_vec = core.VarBase(core.VarDesc.VarType.FP32, [], 'program_out_scope', core.VarDesc.VarType.STEP_SCOPES, True)
    tmp_scope_vec.value().set_scope(self._inner_scope)
    return (input_vars, out_vars, tmp_scope_vec)
Prepare inputs, outputs, attrs.
def _prepare(self, inputs):
    '\n        \n        '
    assert isinstance(inputs, (tuple, list))
    flatten_inputs = flatten(inputs)
    input_vars = []
    for (i, value) in enumerate(flatten_inputs):
        if isinstance(value, np.ndarray):
            var = core.VarBase(value=value, name=self._inputs[i].desc.name(), persistable=False, place=framework._current_expected_place(), zero_copy=True)
        elif isinstance(value, core.VarBase):
            value.name = self._inputs[i].desc.name()
            if value.stop_gradient:
                var = paddle.to_tensor(value, dtype=value.dtype, place=framework._current_expected_place(), stop_gradient=True)
                var.name = value.name
            else:
                var = value
        else:
            continue
        input_vars.append(var)
    out_vars = []
    for idx in self._outputs.var_ids:
        var = self._outputs[idx]
        assert isinstance(var, framework.Variable)
        var_desc = var.desc
        var_base = core.VarBase(var_desc.dtype(), var_desc.shape(), var_desc.name(), var_desc.type(), False)
        out_vars.append(var_base)
    tmp_scope_vec = core.VarBase(core.VarDesc.VarType.FP32, [], 'program_out_scope', core.VarDesc.VarType.STEP_SCOPES, True)
    tmp_scope_vec.value().set_scope(self._inner_scope)
    return (input_vars, out_vars, tmp_scope_vec)