Based on the posted operation your output would have the shape [40, 28672, 256, 256], thus 75161927680 elements.
If you are using float32 (the default dtype) this would use 40 * 28672 * 256 * 256 * 4 / 1024**3 = 280GB.