Gradient for TensorArraySplit. Args: op: Forward TensorArraySplit op. flow: Gradient `Tensor` flow to TensorArraySplit. Returns: A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad.
(op, flow)
| 228 | @ops.RegisterGradient("TensorArraySplitV2") |
| 229 | @ops.RegisterGradient("TensorArraySplitV3") |
| 230 | def _TensorArraySplitGrad(op, flow): |
| 231 | """Gradient for TensorArraySplit. |
| 232 | |
| 233 | Args: |
| 234 | op: Forward TensorArraySplit op. |
| 235 | flow: Gradient `Tensor` flow to TensorArraySplit. |
| 236 | |
| 237 | Returns: |
| 238 | A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad. |
| 239 | """ |
| 240 | handle = op.inputs[0] |
| 241 | dtype = op.get_attr("T") |
| 242 | grad_source = _GetGradSource(flow) |
| 243 | g = (tensor_array_ops.TensorArray(dtype=dtype, handle=handle, flow=flow, |
| 244 | colocate_with_first_write_call=False) |
| 245 | .grad(source=grad_source, flow=flow)) |
| 246 | grad = g.concat() |
| 247 | # handle, value, lengths, flow_in |
| 248 | return [None, grad, None, flow] |
nothing calls this directly
no test coverage detected