Elementi-wise comparison for t == x. Args: t (Tensor): left hand side operand x (Tensor or float): right hand side operand Returns: a Tensor with each element being t[i] == x ? 1.0f:0.0f, or t[i] == x[i] ? 1.0f:0.0f
(t, x)
| 1216 | |
| 1217 | |
| 1218 | def eq(t, x): |
| 1219 | '''Elementi-wise comparison for t == x. |
| 1220 | |
| 1221 | Args: |
| 1222 | t (Tensor): left hand side operand |
| 1223 | x (Tensor or float): right hand side operand |
| 1224 | |
| 1225 | Returns: |
| 1226 | a Tensor with each element being t[i] == x ? 1.0f:0.0f, |
| 1227 | or t[i] == x[i] ? 1.0f:0.0f |
| 1228 | ''' |
| 1229 | return t == x |
| 1230 | |
| 1231 | |
| 1232 | def add(lhs, rhs, ret=None): |