MCPcopy Create free account
hub / github.com/apache/singa / relu

Function relu

python/singa/autograd.py:442–451  ·  view source on GitHub ↗

Relu means rectified linear function, i.e, y = max(0, x) is applied to the CTensors elementwise. Args: x (Tensor): input tensor. Returns: a new Tensor whose element y = x if x >= 0; otherwise 0.

(x)

Source from the content-addressed store, hash-verified

440
441
442def relu(x):
443 """
444 Relu means rectified linear function, i.e, y = max(0, x) is applied to the
445 CTensors elementwise.
446 Args:
447 x (Tensor): input tensor.
448 Returns:
449 a new Tensor whose element y = x if x >= 0; otherwise 0.
450 """
451 return ReLU()(x)[0]
452
453
454class Less(Operator):

Callers 1

Cuda>Method · 0.85

Calls 1

ReLUClass · 0.70

Tested by

no test coverage detected