Add an activation function. Parameters: input : Tensor The input tensor on which the activation function is applied. act_type : trt.ActivationType The type of the activation (RELU, TANH, SIGMOID, ...). The following closures are defined in func
(input: Tensor, act_type: trt.ActivationType)
| 765 | |
| 766 | |
| 767 | def activation(input: Tensor, act_type: trt.ActivationType) -> Tensor: |
| 768 | ''' |
| 769 | Add an activation function. |
| 770 | |
| 771 | Parameters: |
| 772 | input : Tensor |
| 773 | The input tensor on which the activation function is applied. |
| 774 | |
| 775 | act_type : trt.ActivationType |
| 776 | The type of the activation (RELU, TANH, SIGMOID, ...). |
| 777 | |
| 778 | The following closures are defined in functional.*: |
| 779 | |
| 780 | relu for op=trt.ActivationType.RELU |
| 781 | tanh for op=trt.ActivationType.TANH |
| 782 | sigmoid for op=trt.ActivationType.SIGMOID |
| 783 | |
| 784 | Returns: |
| 785 | The tensor produced by the activation layer. |
| 786 | ''' |
| 787 | layer = default_trtnet().add_activation(input.trt_tensor, act_type) |
| 788 | return _create_tensor(layer.get_output(0), layer) |
| 789 | |
| 790 | |
| 791 | def int_clip(input: Tensor, lower: int, upper: int) -> Tensor: |
nothing calls this directly
no test coverage detected