fix OSS mobile CI (#25755)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25755

PR #25721 breaks mobile CI (with USE_STATIC_DISPATCH=1) due to circular
header dependency.
Move 'ATen/core/Tensor.h' back into '#ifdef BUILD_NAMEDTENSOR' to work
around the CI issue.

Test Plan: - build android library locally

Differential Revision: D17223997

Pulled By: ljk53

fbshipit-source-id: d8b5fd26e332953f1b592758fc76947ea2af94dc
diff --git a/aten/src/ATen/NamedTensorUtils.h b/aten/src/ATen/NamedTensorUtils.h
index 5c80914..cef62ad 100644
--- a/aten/src/ATen/NamedTensorUtils.h
+++ b/aten/src/ATen/NamedTensorUtils.h
@@ -1,10 +1,11 @@
 #pragma once
 #include <ATen/NamedTensor.h>
+
+#ifdef BUILD_NAMEDTENSOR
 #include <ATen/core/Tensor.h>
 #include <ATen/core/DimVector.h>
 #include <functional>
 
-#ifdef BUILD_NAMEDTENSOR
 namespace at {
 
 using NameVector = SmallVector<Dimname, kDimVectorStaticSize>;