Skip to content
Commit 18db4ce4 authored by Geoffrey Martin-Noble's avatar Geoffrey Martin-Noble Committed by A. Unique TensorFlower
Browse files

Allow element type traits to operate on scalars

This allows confirming that a scalar argument has the same element type as a shaped one. It's easy to validate a type is shaped on its own if that's desirable, so this shouldn't make that use case harder. This matches the behavior of other traits that operate on element type (e.g. AllElementTypesMatch). Also this makes the code simpler because now we just use getElementTypeOrSelf.

Verified that all uses in core already check the type is shaped in another way.

PiperOrigin-RevId: 273068507
parent 8b9b72ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment