MCPcopy
hub / github.com/apache/tvm / softmax

Function softmax

python/tvm/contrib/cudnn.py:877–900  ·  view source on GitHub ↗

Compute softmax using CuDNN Parameters ---------- x : tvm.te.Tensor The input tensor axis : int The axis to compute the softmax Returns ------- ret : tvm.te.Tensor The result tensor

(x, axis=-1)

Source from the content-addressed store, hash-verified

875
876
877def softmax(x, axis=-1):
878 """Compute softmax using CuDNN
879
880 Parameters
881 ----------
882 x : tvm.te.Tensor
883 The input tensor
884
885 axis : int
886 The axis to compute the softmax
887
888 Returns
889 -------
890 ret : tvm.te.Tensor
891 The result tensor
892 """
893 return te.extern(
894 x.shape,
895 [x],
896 lambda ins, outs: tvm.tirx.call_packed(
897 "tvm.contrib.cudnn.softmax.forward", ins[0], outs[0], axis
898 ),
899 name="y",
900 )
901
902
903def log_softmax(x, axis=-1):

Callers

nothing calls this directly

Calls 1

call_packedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…