• Home
  • Raw
  • Download

Lines Matching full:names

13 1. use names to provide additional automatic runtime correctness checks
14 2. propagate names from input tensors to output tensors
162 :attr:`Tensor.names`,See documentation
250 Keeps input names
255 - Check names: None
256 - Propagate names: input tensor's names are propagated to the output.
260 >>> x = torch.randn(3, 3, names=('N', 'C'))
261 >>> x.abs().names
275 list of dimension names.
277 - Check names: If :attr:`dim` or :attr:`dims` is passed in as a list of names,
278 check that those names exist in :attr:`self`.
279 - Propagate names: If the dimensions of the input tensor specified by :attr:`dim`
280 or :attr:`dims` are not present in the output tensor, then the corresponding names
281 of those dimensions do not appear in ``output.names``.
285 >>> x = torch.randn(1, 3, 3, 3, names=('N', 'C', 'H', 'W'))
286 >>> x.squeeze('N').names
289 >>> x = torch.randn(3, 3, 3, 3, names=('N', 'C', 'H', 'W'))
290 >>> x.sum(['N', 'C']).names
294 >>> x = torch.randn(3, 3, 3, 3, names=('N', 'C', 'H', 'W'))
295 >>> x.sum(['N', 'C'], keepdim=True).names
301 Unifies names from inputs
306 tensors. To perform explicit broadcasting by names, use :meth:`Tensor.align_as`.
308 - Check names: All names must match positionally from the right. i.e., in
309 ``tensor + other``, ``match(tensor.names[i], other.names[i])`` must be true for all
311 - Check names: Furthermore, all named dimensions must be aligned from the right.
314 - Propagate names: unify pairs of names from the right from both tensors to
315 produce output names.
323 >>> tensor = torch.randn(3, 3, names=('N', None))
324 >>> other = torch.randn(3, 3, names=(None, 'C'))
325 >>> (tensor + other).names
328 Check names:
330 - ``match(tensor.names[-1], other.names[-1])`` is ``True``
331 - ``match(tensor.names[-2], tensor.names[-2])`` is ``True``
336 Finally, the output names are computed with
344 >>> tensor = torch.randn(3, 3, names=('N', 'C'))
345 >>> other = torch.randn(3, names=('N',))
346 >>> (tensor + other).names
351 # Dimensions aren't aligned when matching tensor.names[-1] and other.names[-1]:
354 >>> tensor = torch.randn(3, 3, names=('N', None))
355 >>> other = torch.randn(3, names=('N',))
356 >>> (tensor + other).names
363 In both of the last examples, it is possible to align the tensors by names
373 Some operations, like :meth:`Tensor.t()`, permute the order of dimensions. Dimension names
379 - Check names: If :attr:`dim` is passed as a name, check that it exists in the tensor.
380 - Propagate names: Permute dimension names in the same way as the dimensions that are
385 >>> x = torch.randn(3, 3, names=('N', 'C'))
386 >>> x.transpose('N', 'C').names
399 - Check names: None
400 - Propagate names: result names are ``(tensor.names[-2], other.names[-1])``.
404 >>> x = torch.randn(3, 3, names=('N', 'D'))
405 >>> y = torch.randn(3, 3, names=('in', 'out'))
406 >>> x.mm(y).names
414 check input names and removes the dimensions that are involved in the dot product:
418 >>> x = torch.randn(3, 3, names=('N', 'D'))
419 >>> y = torch.randn(3, names=('something',))
420 >>> x.mv(y).names
426 - Check names: Check that the batch dimensions of the inputs are aligned and broadcastable.
428 - Propagate names: result names are obtained by unifying the batch dimensions and removing
430 ``unify(tensor.names[:-2], other.names[:-2]) + (tensor.names[-2], other.names[-1])``.
436 >>> x = torch.randn(3, 3, 3, 3, names=('A', 'B', 'C', 'D'))
437 >>> y = torch.randn(3, 3, 3, names=('B', 'E', 'F'))
438 >>> torch.matmul(x, y).names
452 Factory functions now take a new :attr:`names` argument that associates a name
457 >>> torch.zeros(2, 3, names=('N', 'C'))
459 [0., 0., 0.]], names=('N', 'C'))
468 - If it has no named dimensions, then the names computed from the operation
470 - If it has any named dimensions, then the names computed from the operation
471 must be exactly equal to the existing names. Otherwise, the operation errors.
473 All in-place methods modify inputs to have names equal to the computed names
479 >>> y = torch.randn(3, 3, names=('N', 'C'))
480 >>> x.names
484 >>> x.names