MCPcopy Create free account
hub / github.com/pytorch/pytorch / __format__

Method __format__

torch/_tensor.py:961–966  ·  view source on GitHub ↗
(self, format_spec)

Source from the content-addressed store, hash-verified

959 return torch.remainder(other, self)
960
961 def __format__(self, format_spec):
962 if has_torch_function_unary(self):
963 return handle_torch_function(Tensor.__format__, (self,), self, format_spec)
964 if self.dim() == 0 and not self.is_meta and type(self) is Tensor:
965 return self.item().__format__(format_spec)
966 return object.__format__(self, format_spec)
967
968 @_handle_torch_function_and_wrap_type_error_to_not_implemented
969 def __rpow__(self, other):

Callers

nothing calls this directly

Calls 3

handle_torch_functionFunction · 0.90
itemMethod · 0.80
dimMethod · 0.45

Tested by

no test coverage detected