microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.49k stars 4.3k forks source link

program crash when get gradient of `ConvolutionTranspose2D` #3884

Open cheyennee opened 6 months ago

cheyennee commented 6 months ago

repo code:

import numpy as np
import cntk as C

x = C.input_variable(shape=(1, 3, 1), needs_gradient=True, dtype=np.float32)
x_val = np.array([[[0.6],
                   [0.6],
                   [0.3]]], dtype=np.float32)

y = C.layers.ConvolutionTranspose2D((3, 3), 1)(x)
g = y.grad({x: x_val})

print("gradients : ", g)

version: cntk 2.7