MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / __init__

Method __init__

imperative/python/megengine/module/vision.py:416–428  ·  view source on GitHub ↗
(self, alpha, lightness, seed=None)

Source from the content-addressed store, hash-verified

414 """
415
416 def __init__(self, alpha, lightness, seed=None):
417 assert seed is None or isinstance(seed, int)
418 super().__init__()
419 self.alpha = alpha
420 self.lightness = lightness
421 self.rng_func = RNG(seed).uniform
422 self.seed = seed
423 self.matrix_nochange = Tensor(
424 np.array([[0, 0, 0], [0, 1, 0], [0, 0, 0]], dtype=np.float32)
425 )
426 self.matrix_effect = Tensor(
427 np.array([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]], dtype=np.float32)
428 )
429
430 def get_kernel(self, inp, c):
431 alpha = self._get_parameter(self.alpha)

Callers

nothing calls this directly

Calls 4

arrayMethod · 0.80
RNGClass · 0.50
TensorClass · 0.50
__init__Method · 0.45

Tested by

no test coverage detected