MCPcopy Create free account
hub / github.com/apache/singa / uniform

Method uniform

examples/model_selection/Trails/singa_pkg_code/tensor.py:500–516  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 15

randomFunction · 0.95
trainFunction · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainFunction · 0.95
trainMethod · 0.95
trainMethod · 0.95
native.pyFile · 0.45
model.pyFile · 0.45
native.pyFile · 0.45
model.pyFile · 0.45
native.pyFile · 0.45

Calls 1

UniformMethod · 0.80

Tested by

no test coverage detected