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

Method __init__

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

Source from the content-addressed store, hash-verified

325 """
326
327 def __init__(self, alpha, strength, seed=None):
328 assert seed is None or isinstance(seed, int)
329 super().__init__()
330 self.alpha = alpha
331 self.strength = strength
332 self.rng_func = RNG(seed).uniform
333 self.seed = seed
334 self.matrix_nochange = Tensor(
335 np.array([[0, 0, 0], [0, 1, 0], [0, 0, 0]], dtype=np.float32)
336 )
337 self.matrix_effect = Tensor(
338 np.array([[-1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=np.float32)
339 )
340
341 def get_kernel(self, inp, c):
342 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