Reduce and Autograd
Reduce¤
sum
¤
sum(axis=None, keepdims=False)
Sum over axis, or over every element when axis is None.
Source code in stackgrad/tensor.py
253 254 255 | |
mean
¤
mean(axis=None, keepdims=False)
Mean over axis, or over every element when axis is None.
Source code in stackgrad/tensor.py
257 258 259 260 261 | |
max
¤
max(axis=None, keepdims=False)
Source code in stackgrad/tensor.py
263 264 | |
min
¤
min(axis=None, keepdims=False)
Source code in stackgrad/tensor.py
266 267 | |
Autograd¤
backward
¤
backward(keep_grads=False)
Backpropagate from this scalar, filling .grad on every leaf (and intermediates if keep_grads).
Source code in stackgrad/tensor.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
zero_grad
¤
zero_grad()
Source code in stackgrad/tensor.py
375 376 | |
no_grad
¤
Context manager to disable gradient tracking during inference.
autocast
¤
autocast(dtype)
Mixed precision: every Linear multiplies in dtype ("bfloat16" or "float16"), all else stays float32.
Source code in stackgrad/tensor.py
31 32 | |