我想将张量输入的某些部分随机设为零。与下面的代码相同:
inputs = layers.Input(shape=input_shape)
t = random.randint(n,m)
g = random.randint(n,m) %% n and m are constant numbers
inputs[t-10:t+10,g-10,g+10] = 0 %% where tensorflow give me error
inputs_normalized = layers.Lambda(mvn)(inputs)
x = layers.MaxPooling2D((2,2),strides=(2,2))(inputs_normalized)
但是我遇到了这个错误:
'Tensor' object does not support item assignment
我该怎么办?请帮助我,实际上Google搜索对我来说还不清楚。