public ComputeGraph(IWeightFactory weightFactory, bool needBack = true)
        {
            weightMatrixFactory = weightFactory as WeightMatrixFactory;


            this.needs_backprop = needBack;
        }
 private void InitWeightsFactory()
 {
     m_weightFactory = new IWeightFactory[m_deviceIds.Length];
     if (m_archType == ArchTypeEnums.GPU_CUDA)
     {
         for (int i = 0; i < m_deviceIds.Length; i++)
         {
             m_weightFactory[i] = new WeightTensorFactory();
         }
     }
     else
     {
         for (int i = 0; i < m_deviceIds.Length; i++)
         {
             m_weightFactory[i] = new WeightMatrixFactory();
         }
     }
 }