MCPcopy Create free account
hub / github.com/pytorch/executorch / _is_float_tensor

Function _is_float_tensor

backends/samsung/quantizer/annotator.py:82–89  ·  view source on GitHub ↗

Check if the node's tensor is a float tensor, so that we can skip quantization for the node since observers only works with float Tensors

(node: Node)

Source from the content-addressed store, hash-verified

80
81
82def _is_float_tensor(node: Node):
83 """Check if the node's tensor is a float tensor,
84 so that we can skip quantization for the node
85 since observers only works with float Tensors
86 """
87 if not _is_fake_tensor(node):
88 return False
89 return node.meta["val"].dtype in [torch.float32, torch.float16]
90
91
92def _mark_nodes_as_annotated(nodes: List[Node]):

Callers 14

annotate_placeholderFunction · 0.70
annotate_2in1outFunction · 0.70
annotate_1in1outFunction · 0.70
annotate_indexFunction · 0.70
annotate_index_putFunction · 0.70
annotate_unbindFunction · 0.70
annotate_conv2dFunction · 0.70
annotate_embeddingFunction · 0.70

Calls 1

_is_fake_tensorFunction · 0.85

Tested by

no test coverage detected