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

Method __mod__

tensorflow/python/framework/tensor_shape.py:558–584  ·  view source on GitHub ↗

Returns `self` modulo `other`. Dimension moduli are computed as follows: ```python tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(n) == tf.compat.v1.Dimension(m % n) tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(None) # equiv. to tf.compat.v1.Dimension(N

(self, other)

Source from the content-addressed store, hash-verified

556 "please use // instead".format(type(other).__name__))
557
558 def __mod__(self, other):
559 """Returns `self` modulo `other`.
560
561 Dimension moduli are computed as follows:
562
563 ```python
564 tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(n) ==
565 tf.compat.v1.Dimension(m % n)
566 tf.compat.v1.Dimension(m) % tf.compat.v1.Dimension(None) # equiv. to
567 tf.compat.v1.Dimension(None)
568 tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(n) # equiv. to
569 tf.compat.v1.Dimension(None)
570 tf.compat.v1.Dimension(None) % tf.compat.v1.Dimension(None) # equiv. to
571 tf.compat.v1.Dimension(None)
572 ```
573
574 Args:
575 other: Another Dimension, or a value accepted by `as_dimension`.
576
577 Returns:
578 A Dimension whose value is `self` modulo `other`.
579 """
580 other = as_dimension(other)
581 if self._value is None or other.value is None:
582 return Dimension(None)
583 else:
584 return Dimension(self._value % other.value)
585
586 def __rmod__(self, other):
587 """Returns `other` modulo `self`.

Callers

nothing calls this directly

Calls 2

as_dimensionFunction · 0.85
DimensionClass · 0.70

Tested by

no test coverage detected