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)
| 529 | return self |
| 530 | |
| 531 | def uniform(self, low, high, inplace=True): |
| 532 | '''Generate a value for each element following a uniform distribution. |
| 533 | |
| 534 | Args: |
| 535 | low (float): the lower bound |
| 536 | high (float): the hight bound |
| 537 | inplace: inplace flag |
| 538 | |
| 539 | Returns: |
| 540 | this tensor |
| 541 | ''' |
| 542 | if not inplace: |
| 543 | # return new tensor |
| 544 | raise NotImplementedError |
| 545 | |
| 546 | singa.Uniform(float(low), float(high), self.data) |
| 547 | return self |
| 548 | |
| 549 | @deprecated(reason="use broadcast instead") |
| 550 | def add_column(self, v): |