public FloatTensor DivElemGPU(FloatTensor tensor, FloatTensor result) { Debug.LogFormat("<color=blue>FloatTensor.DivElemGPU dataOnGpu: {0}</color>", dataOnGpu); if (dataOnGpu) { if (tensor.id != this.id) { shader.SetBuffer(DivElemKernel, "DivElemDataA", dataBuffer); shader.SetBuffer(DivElemKernel, "DivElemDataB", tensor.dataBuffer); shader.SetBuffer(DivElemKernel, "DivElemDataResult", result.dataBuffer); shader.Dispatch(DivElemKernel, this.size, 1, 1); } else { result.ZeroGPU_(); result.AddScalarGPU_((float)1); return(result); } } return(result); }