Open asieradzk opened 6 months ago
I tried to implement my own module and when attempting to read training property I get access violation error
from torchsharp
public virtual bool training { get { bool result = NativeMethods.THSNN_Module_is_training(handle); CheckForErrors(); return result; } }
From my module:
public override Tensor forward(Tensor input) { Tensor weight = training ? _weightMu + _weightSigma * _weightEpsilon : _weightMu; Tensor bias = _biasMu is not null ? (training ? _biasMu + _biasSigma * _biasEpsilon : _biasMu) : null; return torch.nn.functional.linear(input, weight, bias); }
I wanted to inherit linear but someone made it sealed for some reason but thats another issue.
failed to reproduce?
@asieradzk The access violation would suggest that the 'handle' field is invalid.
I tried to implement my own module and when attempting to read training property I get access violation error
from torchsharp
From my module: