提交 0d10d5d0 编写于 作者: B Blake Hechtman 提交者: TensorFlower Gardener

Internal change

PiperOrigin-RevId: 327864391
Change-Id: Id021118bc279f646ec693ec4af3f1f59cb63c38e
上级 f8d80a78
......@@ -1891,7 +1891,7 @@ Status LayoutAssignment::RunOnComputation(
? ShapeUtil::GetSubshape(instruction->literal().shape(),
buffer.index())
.layout()
: LayoutUtil::GetDefaultLayoutForShape(buffer.shape());
: GetUnconstrainedLayout(buffer);
TF_RETURN_IF_ERROR(constraints.SetBufferLayout(new_layout, buffer,
/*mandatory=*/false));
......
......@@ -27,6 +27,7 @@ limitations under the License.
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "tensorflow/compiler/xla/layout_util.h"
#include "tensorflow/compiler/xla/service/call_graph.h"
#include "tensorflow/compiler/xla/service/computation_layout.h"
#include "tensorflow/compiler/xla/service/hlo_computation.h"
......@@ -338,6 +339,9 @@ class LayoutAssignment : public HloModulePass {
const ResultLayoutConstraint& layout_constraint,
LayoutConstraints* constraints);
virtual Layout GetUnconstrainedLayout(const LogicalBuffer& buffer) {
return LayoutUtil::GetDefaultLayoutForShape(buffer.shape());
}
// Called after layouts of an instruction have been finalized to allow
// subclasses to check for platform specific assumptions.
virtual Status Verify(const HloInstruction* instruction) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册