111,090
社区成员




Marshal.StructureToPtr(_session, _copiedSess, true);.
会一直报错,说不是结构体,或者说是null
MarshalDirectiveException: Type Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid which is passed to unmanaged code must have a StructLayout attribute.
(wrapper other) NNOnnx.NNSession.StructureToPtr(object,intptr,bool)
class 是托管的,地址随时在变。所以你非要如此只能先申明不让gc管理,然后用ValueTuple包一下
当然我不保证可以行,所以如果不行请按照对方的说明,自己生成一个同样的结构体,然后把数据复制到这个结构里