當我運行下面的代碼時,我得到一個棄用說產品已被替換爲頻道。 function source(dir)
filelist = readdir(dir)
for filename in filelist
name,ext = splitext(filename)
if ext == ".jld"
produce(filename)
m,n =size(l.x)
for batch=1:m
l.ly = l.y[batch,:]
l.jacobian .= -l.ly .* l.ly'
l.jacobian[diagind(l.jacobian)] .= l.ly.*(1.0.-l.ly)
# # n x 1 = n x n * n x 1
l.dldx[batch,:] =
如何訪問函數的主體? 上下文:我有模塊內的功能,我用特定的參數值執行。我想要「記錄」這些參數值和相應的功能形式。下面我嘗試: module MainModule
using Parameters # Parameters provides unpack() macro
using DataFrames # DataFrames used to store results in
我試圖擴展方法Base.∘。 試圖定義 function Base.∘(f₁::Transformation, f₂::Transformation)
println("baz")
end
提供了以下錯誤: syntax: expected "end" in definition of function "Base"
我在做什麼錯?我該如何擴展它?