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

Function _num_elements

tensorflow/python/keras/utils/losses_utils.py:52–55  ·  view source on GitHub ↗

Computes the number of elements in `losses` tensor.

(losses)

Source from the content-addressed store, hash-verified

50
51
52def _num_elements(losses):
53 """Computes the number of elements in `losses` tensor."""
54 with K.name_scope('num_elements') as scope:
55 return math_ops.cast(array_ops.size(losses, name=scope), dtype=losses.dtype)
56
57
58def reduce_weighted_loss(weighted_losses,

Callers 1

reduce_weighted_lossFunction · 0.70

Calls 3

name_scopeMethod · 0.45
castMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected