`_scalar` was fixed to call `math_ops.cast` because `Tensor` only has an `astype` method after `enable_numpy_methods_on_tensor()` has run. Five more `astype` calls, in four other functions, still fail without that opt-in, which is what a plain `import tensorflow` gives you:
>>> tnp.around([1.5, 2.5])
AttributeError: EagerTensor object has no attribute 'astype'.
`around` casts back to the argument's dtype on every path, so it fails on any input, taking `tnp.round` and `Tensor.__round__` with it. `heaviside` and `average` fail on integer input, `_with_index_update_helper` on any.
`astype` is installed as an alias of `math_ops.cast`, so calling `cast` directly is the same operation without the dependency on the opt-in. Neither module calls `astype` after this change.
The regression tests go in the module added for the `_scalar` fix, plus an `np_array_ops` counterpart. Both deliberately skip the opt-in, which is what makes these paths observable in a test.