Turn relatively expensive CHECK on Shape::rank() into a DCHECK.
Eliminates 2.6% of compilation time in profiling one compile-intensive workload. PiperOrigin-RevId: 322601531 Change-Id: I8786323b318d54cdaf9baaea318a7abf4bccdd59
This commit is contained in:
parent
a1cec7e442
commit
177790aafc
@ -49,7 +49,7 @@ class Shape {
|
|||||||
// Returns the rank (number of dimensions) of the given shape. Shape must be
|
// Returns the rank (number of dimensions) of the given shape. Shape must be
|
||||||
// an array.
|
// an array.
|
||||||
int64 rank() const {
|
int64 rank() const {
|
||||||
CHECK(IsArray()) << "Non-arrays do not have a rank, shape: " << ToString();
|
DCHECK(IsArray()) << "Non-arrays do not have a rank, shape: " << ToString();
|
||||||
return dimensions_.size();
|
return dimensions_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user