RegExp /\c/不会触发任何语法错误.
console.log(/\c/)Run Code Online (Sandbox Code Playgroud)
问题是为什么它不是语法错误.由于语言天赋,我猜Pattern→交通Disjunction→交通Alternative→交通Term→交通Atom→交通\ AtomEscape→交通CharacterEscape→交通IdentityEscape的话,就到达SourceCharacter but not c,它不通过的情况相符but not c.
https://www.ecma-international.org/ecma-262/8.0/#sec-regular-expressions-patterns
我想知道我是不是错了.
我是TensorFlow的新手.
https://js.tensorflow.org/tutorials/core-concepts.html中的"内存管理:dispose和tf.tidy"部分说我们必须以特殊方式管理记忆.
但是,tfjs-layers(例如tf.Model和Layer)中的类似乎没有dispose并且tf.tidy不接受那些作为返回值.
所以我的问题是:
tf.Model自动管理的回忆?示例代码:
function defineModel(
regularizerRate: number,
learningRate: number,
stateSize: number,
actionSize: number,
): tf.Model {
return tf.tidy(() => { // Compile error here, I couldn't return model.
const input = tf.input({
name: "INPUT",
shape: [stateSize],
dtype: "int32" as any, // TODO(mysticatea): https://github.com/tensorflow/tfjs/issues/120
})
const temp = applyHiddenLayers(input, regularizerRate)
const valueOutput = applyValueLayer(temp, regularizerRate)
const policyOutput = applyPolicyLayer(temp, actionSize, …Run Code Online (Sandbox Code Playgroud)