MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _convert_random

Function _convert_random

tensorflow/python/ops/parallel_for/pfor.py:2546–2560  ·  view source on GitHub ↗
(pfor_input, op_type, *args, **kw_args)

Source from the content-addressed store, hash-verified

2544@RegisterPForWithArgs("RandomStandardNormal")
2545@RegisterPForWithArgs("TruncatedNormal")
2546def _convert_random(pfor_input, op_type, *args, **kw_args):
2547 del args
2548 del kw_args
2549 inputs = [pfor_input.unstacked_input(i) for i in range(pfor_input.num_inputs)]
2550 # inputs[0] is "shape"
2551 inputs[0] = array_ops.concat(
2552 [pfor_input.pfor.loop_len_vector, inputs[0]], axis=0)
2553 logging.warning(
2554 "Note that %s inside pfor op may not give same output as "
2555 "inside a sequential loop.", op_type)
2556 outputs = _create_op(
2557 op_type,
2558 inputs, [x.dtype for x in pfor_input.outputs],
2559 attrs=pfor_input.op.node_def.attr).outputs
2560 return [wrap(x, True) for x in outputs]
2561
2562
2563@RegisterPFor("RandomGamma")

Callers

nothing calls this directly

Calls 5

_create_opFunction · 0.85
unstacked_inputMethod · 0.80
wrapFunction · 0.70
rangeFunction · 0.50
concatMethod · 0.45

Tested by

no test coverage detected