我最近在查看模型摘要时遇到了这种情况。
[(None, 16)]我想知道和之间有什么区别(None, 16)?为什么输入层有这样的输入形状?
我试图创建自己的Writer类型,然后我也为它创建了一个实例.无论如何,我继续得到这个错误:
Illegal instance declaration for ‘Monad (Writer String)’
(All instance types must be of the form (T a1 ... an)
where a1 ... an are *distinct type variables*,
and each type variable appears at most once in the instance head.
Use FlexibleInstances if you want to disable this.)
In the instance declaration for ‘Monad (Writer String)’
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
newtype Writer log a = Writer {runWriter :: (a,log)}
instance Monad (Writer String) where
return a = Writer (a, "")
ma >>= k …Run Code Online (Sandbox Code Playgroud)