Generate a value for each element following a uniform distribution. Args: low (float): the lower bound high (float): the hight bound inplace: inplace flag Returns: this tensor
(self, low, high, inplace=True)
| 498 | return self |
| 499 | |
| 500 | def uniform(self, low, high, inplace=True): |
| 501 | '''Generate a value for each element following a uniform distribution. |
| 502 | |
| 503 | Args: |
| 504 | low (float): the lower bound |
| 505 | high (float): the hight bound |
| 506 | inplace: inplace flag |
| 507 | |
| 508 | Returns: |
| 509 | this tensor |
| 510 | ''' |
| 511 | if not inplace: |
| 512 | # return new tensor |
| 513 | raise NotImplementedError |
| 514 | |
| 515 | singa.Uniform(float(low), float(high), self.data) |
| 516 | return self |
| 517 | |
| 518 | @deprecated(reason="use broadcast instead") |
| 519 | def add_column(self, v): |
no test coverage detected