Apply a function on the wrapped tensor. The tensor will be the second argument of func. This is because many symbolic functions (such as tensorpack's layers) takes 'scope' as the first argument. Returns: LinearWrap: ``LinearWrap(func(args[0], se
(self, func, *args, **kwargs)
| 76 | return LinearWrap(ret) |
| 77 | |
| 78 | def apply2(self, func, *args, **kwargs): |
| 79 | """ |
| 80 | Apply a function on the wrapped tensor. The tensor |
| 81 | will be the second argument of func. |
| 82 | |
| 83 | This is because many symbolic functions |
| 84 | (such as tensorpack's layers) takes 'scope' as the first argument. |
| 85 | |
| 86 | Returns: |
| 87 | LinearWrap: ``LinearWrap(func(args[0], self.tensor(), *args[1:], **kwargs))``. |
| 88 | """ |
| 89 | ret = func(args[0], self._t, *(args[1:]), **kwargs) |
| 90 | return LinearWrap(ret) |
| 91 | |
| 92 | def __call__(self): |
| 93 | """ |
no test coverage detected