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

Function Uniform

src/core/tensor/tensor.cc:1556–1567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1554
1555template <typename SType>
1556void Uniform(const SType low, const SType high, Tensor *out) {
1557 TYPE_LANG_SWITCH(out->data_type(), DType, out->device()->lang(), Lang, {
1558 auto l = TypeCast<SType, DType>(low);
1559 auto h = TypeCast<SType, DType>(high);
1560 Tensor &outRef = *out;
1561 out->device()->Exec(
1562 [l, h, outRef](Context *ctx) mutable {
1563 Uniform<DType, Lang>(l, h, &outRef, ctx);
1564 },
1565 {}, {out->block()}, "Uniform", true);
1566 });
1567}
1568
1569template void Uniform<float>(const float low, const float high, Tensor *out);
1570

Callers 9

TEST_FFunction · 0.50
BackwardConcatRowTestFunction · 0.50
BackwardConcatColumnTestFunction · 0.50
TEST_FFunction · 0.50
ForwardSliceRowTestFunction · 0.50
ForwardSliceColumnTestFunction · 0.50
TESTFunction · 0.50
ForwardMethod · 0.50
BackwardMethod · 0.50

Calls 5

data_typeMethod · 0.80
langMethod · 0.80
deviceMethod · 0.80
ExecMethod · 0.80
blockMethod · 0.45

Tested by 7

TEST_FFunction · 0.40
BackwardConcatRowTestFunction · 0.40
BackwardConcatColumnTestFunction · 0.40
TEST_FFunction · 0.40
ForwardSliceRowTestFunction · 0.40
ForwardSliceColumnTestFunction · 0.40
TESTFunction · 0.40