We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Higher-order templates cover parts of #31.
However their syntax is hard to read, for example:
proc sigmoid_cross_entropy_backward*[T]( gradient: Tensor[T] or T, cached_tensor: Tensor[T], target: Tensor[T] ): Tensor[T] {.inline.} = let batch_size = cached_tensor.shape[^1] # Deal with scalar and tensor gradient when gradient is T: let grad = gradient elif gradient is Tensor: let grad = gradient.data[gradient.offset] return map2T(cached_tensor, target, grad * (1 / (1 + exp(-x)) - y) / T(batch_size))
The last part would be more readable as:
result = map2T(cached_tensor, target): grad * (1 / (1 + exp(-x)) - y) / T(batch_size)
The text was updated successfully, but these errors were encountered:
598eb41
No branches or pull requests
Higher-order templates cover parts of #31.
However their syntax is hard to read, for example:
The last part would be more readable as:
The text was updated successfully, but these errors were encountered: