@@ -1171,13 +1171,17 @@ def __init__(self, cst: Any):
11711171 Var .__init__ (self , np .array (cst , dtype = np .int64 ), op = "Identity" )
11721172 elif isinstance (cst , float ):
11731173 Var .__init__ (self , np .array (cst , dtype = np .float64 ), op = "Identity" )
1174+ elif isinstance (cst , complex ):
1175+ Var .__init__ (self , np .array (cst , dtype = np .complex128 ), op = "Identity" )
11741176 elif isinstance (cst , list ):
11751177 if all (isinstance (t , bool ) for t in cst ):
11761178 Var .__init__ (self , np .array (cst , dtype = np .bool_ ), op = "Identity" )
11771179 elif all (isinstance (t , (int , bool )) for t in cst ):
11781180 Var .__init__ (self , np .array (cst , dtype = np .int64 ), op = "Identity" )
11791181 elif all (isinstance (t , (float , int , bool )) for t in cst ):
11801182 Var .__init__ (self , np .array (cst , dtype = np .float64 ), op = "Identity" )
1183+ elif all (isinstance (t , (float , int , bool , complex )) for t in cst ):
1184+ Var .__init__ (self , np .array (cst , dtype = np .complex128 ), op = "Identity" )
11811185 else :
11821186 raise ValueError (
11831187 f"Unable to convert cst (type={ type (cst )} ), value={ cst } ."
0 commit comments