np中代码如下,可运行成功:
S = sigma + S_p
S1=np.log(S)
cp的代码如下,运行不正常:
S1=sigma + S_p
S = cp.logistic(S1)
报错:
ValueError: setting an array element with a sequence.
TypeError: float() argument must be a string or a number, not 'AddExpression'
做如下修改,即可成功运行: