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

Method uniform

python/singa/tensor.py:531–547  ·  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

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

Callers 11

randomFunction · 0.95
xavierFunction · 0.45
_random_fillFunction · 0.45
initializeMethod · 0.45
initializeMethod · 0.45
enhanceFunction · 0.45
random_crop_resizeMethod · 0.45
generate_dataMethod · 0.45
reduceSum_testMethod · 0.45
reduceMean_testMethod · 0.45

Calls 1

UniformMethod · 0.80

Tested by 4

generate_dataMethod · 0.36
reduceSum_testMethod · 0.36
reduceMean_testMethod · 0.36